This is an occasional, recurring problem for me. I will make an arbitrary change to my project and in turn VisualStudio will give me 96 namespace errors. They're almost always errors with my XAML namespace declarations, but I know those classes exist in the namespace.
I have cleaned & built, and rebuilt many times, as well as restarting VS with no success.
Examples:
In this case, it is the class ExpandedConverter which "does not exist" in the namespace clr-namespace:NineGridViewer. One possible issue could be that I have organized my project into folders, for example the converters are all in IValueConverters folder and MainWindow is in Views folder. But the namespaces have not changed
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:nineGridViewer="clr-namespace:NineGridViewer"
Title="NineGridViewer" Height="900" Width="900">
<Window.Resources>
<nineGridViewer:ExpandedConverter x:Key="ExpandedConverter"/>
<nineGridViewer:StringToBrushConverter x:Key="StringToBrushConverter"/>
</Window.Resources>
namespace NineGridViewer {
/// <summary>
/// Binds the isExpanded property of the UI Expanders to the ViewModel's CurrentExpanded property
/// </summary>
public class ExpandedConverter : IValueConverter
{
public object Convert(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
string input = value as string;
string param = parameter as string;
if (String.IsNullOrEmpty(input) || String.IsNullOrEmpty(param))
{
throw new ArgumentNullException();
}
return Equals(input, param);
}
public object ConvertBack(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return parameter;
}
}
}
A compile error is preventing your assembly[ies] from being built, and thus Visual Studio is unable to inspect them and use them in the XAML designer and other tools.
That is why you get all these seemingly missing classes errors.
There should be a "root" error (usually at the bottom of the list), which is a real compile error. If you fix that all other errors should disappear on build.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With