WPF designer issues : XDG0008 The name "NumericTextBoxConvertor" does not exist in the namespace "clr-namespace:PulserTester.Convertors"
Solution 1
I just want to reiterate a solution that Bradley Uffner mentioned buried in the comments above.
-
Close Visual Studio
-
Delete the hidden
.vsfolder -
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:
- Close All Visual Studio
- Delete the hidden .VS folder
- Open Visual Studio again
- Rebuild your project
Solution 5
Solved the same problem. Steps:
- Update Visual Studio.
- Close/open it.
- Rebuild.
Related videos on Youtube
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, 2022Comments
-
Uwe Keim 10 monthsI 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:
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 over 4 yearsare this converter within the same assembly asPulserTester.windows.ConfigPagewindow? -
Admin over 4 years@vasily.sib still not work... -
Bradley Uffner over 4 yearsand 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 over 4 yearsRebuild the project and it should be able to identify the converter. Also close all files while doing rebuild. -
Admin over 4 years@vasily.sib they on the same Project if that is your question.. -
Admin over 4 years@BradleyUffner Not work :( -
Neil B over 4 yearsTry deleting the Convertors:NumericTextBoxConvertor and then adding it back in. This has already worked for me. -
Admin over 4 years@NeilB Nothing... T_T -
vasily.sib over 4 yearsare you add this lines (converter's) by hand or by means of visual studio? -
Admin over 4 years@vasily.sib witch lines? this "xmlns:Convertors="clr-namespace:PulserTester.Convertors"" ? I added it by heands -
vasily.sib over 4 yearsok, are there any other errors, that prevent project from build? If you delete all lines about this converter, will project build succesfully? -
Admin over 4 years@vasily.sib Nop "========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========" -
vasily.sib over 4 yearsnow try step-by-step: addxmlns:conv="clr-namespace:PulserTester.Convertors"- Build - add<conv:NumericTextBoxConvertor x:Key="NumericTextBoxConvertor" />to<Window.Resources>- Build - addNumericTextBoxConvertorto binding - Build -
Admin over 4 years@vasily.sib Still the same error on Resources line... :( -
vasily.sib over 4 yearsoh:( another guess - when you type in XAML<conv:and hit Ctrl+Space what is showing to you by IntelliSense? -
Admin over 4 years@vasily.sib It is just show option to chose this text : NumericTextBoxConvertor -
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 over 4 years@GK I run it for some hours and it run fine... but still the errors... -
G K over 4 yearsYou 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 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 over 4 yearsI 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 over 4 yearsI 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 over 4 years@GK Its part of a solution of Winform project. maybe it can be a problem? -
ΩmegaMan over 4 yearsSince 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 about 4 yearsPlease 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 over 3 yearsMy environment was 4.6.1. I switched to 4.7.2 and it compiled OK. Thanks for your comment here, this one worked. -
LaoR about 3 yearsFor me too, solved XDG0008. Should be marked as the answer. -
Fütemire almost 3 yearsThanks for all the up-votes, but again the credit is @Bradley Uffner's. ;) -
Sevenate almost 3 yearsUpdate 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 over 2 yearsWorked fine, many thanks @Bradley. This worked also on VS 16.8.0 preview 4 -
Leandro Paixão about 1 yearI had the same problem, I just had to do a rebuild.
