WPF designer issues : XDG0008 The name "NumericTextBoxConvertor" does not exist in the namespace "clr-namespace:PulserTester.Convertors"

50,715

Solution 1

I just want to reiterate a solution that Bradley Uffner mentioned buried in the comments above.

  1. Close Visual Studio

  2. Delete the hidden .vs folder

  3. Open Visual Studio and rebuild your project

Keep in mind that this is a very generic error that has multiple causes and solutions, so this may not work for you, but it's definitely worth a shot since I know it has worked for me in the past on several occasions.

Solution 2

I met the same issue. I tried to build and rebuild my solution, but it didn't work. Finally, I've closed Visual Studio and re-opened it, and it's fixed!

Solution 3

You can switch to another framework version then switch back to your version, in my case I'm using VS 16.4. I changed from framework 4.6.2 to 4.7.2 then switch back to 4.6.2.

This simple action solve XDG0008 and XDG0012 in my project.

Solution 4

I met the similar issue while viewing the workflow xaml in designer view mode. It can be resolved by below steps:

  1. Close All Visual Studio
  2. Delete the hidden .VS folder
  3. Open Visual Studio again
  4. Rebuild your project

Solution 5

Solved the same problem. Steps:

  • Update Visual Studio.
  • Close/open it.
  • Rebuild.
Share:
50,715

Related videos on Youtube

Uwe Keim
Author by

Uwe Keim

German developer. Some of my apps: SharePoint Systemhaus Göppingen (zwischen Stuttgart und Ulm) Eigene Homepage erstellen Test Management Software Windows 10 Ereignisanzeige Very proud father of Felix (2012) and Ina (2014). Loves running, climbing and Indian food. Code Project member #234.

Updated on July 19, 2022

Comments

  • Uwe Keim
    Uwe Keim 10 months

    I have an error that not let me see my designer.. but I have no error on a build and my program runs fine with no problem

    I have tried to:

    • Clean and Rebuild
    • Update Visual Studio
    • Repair Visual Studio
    • Restart my pc

    Nothing helped. I have no idea what more I can to do to solve it.

    I have to try to see in here and not worked for me even after restarted visual studio, re-built the solution

    the name <...> does not exist in the namespace clr-namespace <...>

    this is my Error:

    enter image description here

    this is Xaml file:

    <Window x:Class="PulserTester.windows.ConfigPage"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                 xmlns:local="clr-namespace:PulserTester.windows"
            xmlns:Convertors="clr-namespace:PulserTester.Convertors"
            mc:Ignorable="d" 
                 d:DesignHeight="575.068" Width="500">
        <Window.Resources>
            <Convertors:NumericTextBoxConvertor x:Key="NumericTextBoxConvertor" />
        </Window.Resources>
        <Grid Background="White">
            <StackPanel>
                <StackPanel Margin="5">
                    <TextBlock HorizontalAlignment="Right">שם הפולסר</TextBlock>
                    <TextBox HorizontalAlignment="Right" MinWidth="100" Text="{Binding PulserName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBox>
                </StackPanel>
                <StackPanel Margin="5">
                    <TextBlock HorizontalAlignment="Right">האם להציג הודעה במצב של כישלון</TextBlock>
                    <CheckBox  HorizontalAlignment="Right" IsChecked="{Binding FailQuestion,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></CheckBox>
                </StackPanel>
                <StackPanel Margin="5">
                    <TextBlock HorizontalAlignment="Right">האם לאפשר בדיקת כיול</TextBlock>
                    <CheckBox  HorizontalAlignment="Right" IsChecked="{Binding CalibrationOption,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></CheckBox>
                </StackPanel>
                <StackPanel Margin="5">
                    <TextBlock HorizontalAlignment="Right">סגנון הבדיקה</TextBlock>
                    <ComboBox HorizontalAlignment="Right" Width="213"
                              ItemsSource="{Binding CheckStyles.Keys}"
                              SelectedItem="{Binding CheckStyleSelected,UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
                              ></ComboBox>
                </StackPanel>
                <StackPanel Margin="5">
                    <TextBlock HorizontalAlignment="Right">מספר המפעל</TextBlock>
                    <ComboBox HorizontalAlignment="Right" Width="213"
                              ItemsSource="{Binding FactoriesNumbers}"
                              SelectedItem="{Binding FactorySelected,UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
                              ></ComboBox>
                </StackPanel>
                <StackPanel Margin="5">
                    <TextBlock HorizontalAlignment="Right">תדירות השמירה בבידקות</TextBlock>
                    <TextBox HorizontalAlignment="Right" MinWidth="100" Text="{Binding SaveBatteryFreq,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged, Converter={StaticResource NumericTextBoxConvertor}}"></TextBox>
                </StackPanel>
                <StackPanel Margin="5">
                    <TextBlock HorizontalAlignment="Right">לאפשר גבולות סטטסיטיים</TextBlock>
                    <CheckBox  HorizontalAlignment="Right" IsChecked="{Binding AllowUsingStatistic, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"></CheckBox>
                </StackPanel>
                <StackPanel Margin="5">
                    <TextBlock HorizontalAlignment="Right">מספר התאים לתחילת הסטטסיטיקה</TextBlock>
                    <TextBox HorizontalAlignment="Right" MinWidth="100" Text="{Binding NumberOfCellToStartTheStatistics,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged, Converter={ StaticResource  NumericTextBoxConvertor}}"></TextBox>
                </StackPanel>
                <StackPanel Margin="5">
                    <TextBlock HorizontalAlignment="Right">מספר התאים להתחול הסטטיסטיקה מחדש</TextBlock>
                    <TextBox HorizontalAlignment="Right" MinWidth="100" Text="{Binding NumberOfCellToRestartTheStatistics,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged, Converter={ StaticResource  NumericTextBoxConvertor}}"></TextBox>
                </StackPanel>
                <StackPanel Margin="5">
                    <Button Command="{Binding Path=SaveCommand}">bb</Button>
                </StackPanel>
            </StackPanel>
        </Grid>
    </Window>
    

    this is my convertor:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows;
    using System.Windows.Data;
    namespace PulserTester.Convertors
    {
        public class NumericTextBoxConvertor : IValueConverter
        {
            public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
            {
                return value.ToString();
            }
            public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
            {
                string val = value.ToString();
                long ret = long.TryParse(new string(val.Where(char.IsDigit).ToArray()), out long result) ? result : 0;
                if (ret > int.MaxValue)
                {
                    ret = int.MaxValue;
                }
                return ret;
            }
        }
    }
    
    • vasily.sib
      vasily.sib over 4 years
      are this converter within the same assembly as PulserTester.windows.ConfigPage window?
    • Admin
      Admin over 4 years
      @vasily.sib still not work...
    • Bradley Uffner
      Bradley Uffner over 4 years
      and if that doesn't work, close visual studio and delete the ".vs" directory that is inside the solution directory, then try again. You may have to show hidden files to see it. Sometimes the designer gets stuck using cached data.
    • Sham
      Sham over 4 years
      Rebuild the project and it should be able to identify the converter. Also close all files while doing rebuild.
    • Admin
      Admin over 4 years
      @vasily.sib they on the same Project if that is your question..
    • Admin
      Admin over 4 years
      @BradleyUffner Not work :(
    • Neil B
      Neil B over 4 years
      Try deleting the Convertors:NumericTextBoxConvertor and then adding it back in. This has already worked for me.
    • Admin
      Admin over 4 years
      @NeilB Nothing... T_T
    • vasily.sib
      vasily.sib over 4 years
      are you add this lines (converter's) by hand or by means of visual studio?
    • Admin
      Admin over 4 years
      @vasily.sib witch lines? this "xmlns:Convertors="clr-namespace:PulserTester.Convertors"" ? I added it by heands
    • vasily.sib
      vasily.sib over 4 years
      ok, are there any other errors, that prevent project from build? If you delete all lines about this converter, will project build succesfully?
    • Admin
      Admin over 4 years
      @vasily.sib Nop "========== Rebuild All: 1 succeeded, 0 failed, 0 skipped =========="
    • vasily.sib
      vasily.sib over 4 years
      now try step-by-step: add xmlns:conv="clr-namespace:PulserTester.Convertors" - Build - add <conv:NumericTextBoxConvertor x:Key="NumericTextBoxConvertor" /> to <Window.Resources> - Build - add NumericTextBoxConvertor to binding - Build
    • Admin
      Admin over 4 years
      @vasily.sib Still the same error on Resources line... :(
    • vasily.sib
      vasily.sib over 4 years
      oh:( another guess - when you type in XAML <conv: and hit Ctrl+Space what is showing to you by IntelliSense?
    • Admin
      Admin over 4 years
      @vasily.sib It is just show option to chose this text : NumericTextBoxConvertor
    • G K
      G K over 4 years
      @jon are you able to run, though some times it might show, but if build is succeed then you can run the application and check it.
    • Admin
      Admin over 4 years
      @GK I run it for some hours and it run fine... but still the errors...
    • G K
      G K over 4 years
      You mean that you are able to run the application but it shows error in ErrorList window? Are you able to see the designer or does it shows as Error?
    • Admin
      Admin over 4 years
      @GK I mean that I am able to run my application fine. But I have an error on my designer I am not able to see that... its show an error
    • G K
      G K over 4 years
      I have faced this issue many times before and even now in some places of current project, I haven't looked yet on how to fix such issues, but will definitely look into it. You can edit your question and say designer issues and post that designer stack trace.
    • G K
      G K over 4 years
      I have tried with your xaml and converter in VS 2017. Initially it showed me not found issue, but once I rebuild my solution, the error went off and I can see designer as well.
    • Admin
      Admin over 4 years
      @GK Its part of a solution of Winform project. maybe it can be a problem?
    • ΩmegaMan
      ΩmegaMan over 4 years
      Since this is a visual studio issue (for you said it builds w/no errors) what version of Visual studio are you using (add it to the tags)? Have you updated Visual Studio to the latest? Have you tried this in Blend?
    • Paul McCarthy
      Paul McCarthy about 4 years
      Please Tweet these errors to Microsoft, if they get enough maybe they'll do something about it. They are currently under the illusion that WPF works perfectly all the time. The reality is that it's about as stable as a Lego bridge.
  • JasonH
    JasonH over 3 years
    My environment was 4.6.1. I switched to 4.7.2 and it compiled OK. Thanks for your comment here, this one worked.
  • LaoR
    LaoR about 3 years
    For me too, solved XDG0008. Should be marked as the answer.
  • Fütemire
    Fütemire almost 3 years
    Thanks for all the up-votes, but again the credit is @Bradley Uffner's. ;)
  • Sevenate
    Sevenate almost 3 years
    Update from August 2020 - this is the only solution that solved for me this issue with VS2019 designer errors. Should be marked as accepted answer.
  • Davide Dolla
    Davide Dolla over 2 years
    Worked fine, many thanks @Bradley. This worked also on VS 16.8.0 preview 4
  • Leandro Paixão
    Leandro Paixão about 1 year
    I had the same problem, I just had to do a rebuild.