WPF problem in visual studio generated file g.vb “Namespace or type..
16-Jun-1414 Leave a comment
This warning was in the Visual Studio generated file. Warning is:
Namespace or type specified in the Imports ‘SRS.WpfControlLibrary1’ doesn’t contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn’t use any aliases. …SRS.WPF.Controls\obj\Debug\ucDataDrivenDGButton.g.vb 15 9 SRS.WPF.Controls
I had renamed the project and the Assembly name and the root namespace.
I did a search for the “SRS.WpfControlLibrary1” and found some required fixes/changes. Although I do not remember its creation this project used a Themes\Generic.xaml with an incorrect namespace, so I changed that.
The Generic.xaml seems to be special and in the AssemblyInfo.vb there was an attribute
<Assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)>
I also cleaned and built the project after the Generic.xaml update and now all ok
Similar Error
With VB Project Namespace change the .g.vb file references the old namespace.
Solution
The xaml had
xmlns:my1=”clr-namespace: … old namespace
Updated this and saved (possibly build also) and the project and the problem went away
End.