Reputation: 77
VisualStudio bugs me with those two errormessages:
The name "SeverityToColorConverter" does not exist in the namespace "clr-namespace:MYNAMESPACE".
and
The name "ReadOnlyTextBoxLineExtendedUnit" does not exist in the namespace "clr-namespace:MYNAMESPACE".
I have a Styles.xaml in the toplevel of my application.
Simplified to the minimum it looks like this:
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:MYNAMESPACE">
<local:SeverityToColorConverter x:Key="SeverityToColorConverter" />
<local:SeverityToImageSourceConverter x:Key="SeverityToImageSourceConverter" />
<Style TargetType="local:ReadOnlyTextBoxLineExtendedUnit" BasedOn="{StaticResource ErrProvErrorTemplateStyle}" />
<Style TargetType="local:TextBoxLine" BasedOn="{StaticResource ErrProvErrorTemplateStyle}" />
</ResourceDictionary>
Both, the ReadOnlyTextBoxLineExtendedUnit
and the TextBoxLine
are in the exact same directory. In their .xaml.vb code there is no namespace specified. Yet VS seems to find only the latter of those two. How can this even be possible?
The same goes for the converters. Some are recognized and same are not.
What is very important here is that the Object Browser finds ALL of those objects.
Maybe it is important to mention that I had a WinForms App that I slowly converted to WPF using compatibility tools from MS. Now I changed entirely to a WPF base app and will host some remaining WinForms. To do this task I manually reimported all files to the new app (maybe there would have been a better solution ...). So I know for sure that my code should work. It has to be some VS crap ... or some issue with the new WPF host I don't understand ...
Yes I tried all the dirty tricks of switching to x86/x64. It solved some of the issues but those remain.
Best Wishes Yatekii
Upvotes: 0
Views: 77
Reputation: 77
So after hours of struggle, trying restarts, switching x86/x64, cleaning the project etc. I found out that "Clean" your project for Visual Studio does not mean clean but rather "delete your exe". Same goes for the rebuild. Only the EXE is checked. Assemblies, object files, autogenerated designer files, everything stays there and stays broken.
In the end, deleting the obj and bin folders worked like a charm. No syntactical errors, just Visual Studio not being at it's senses :)
Upvotes: 1