Wpf – warning BC40056: Namespace or type specified in the Imports ‘MS.Internal.Xaml.Builtins’ doesn’t contain any public member or cannot be found

vb.netvisual-studio-2008wpf

I have a WPF VB.NET project in Visual Studio 2008. For some reason, Visual Studio thinks that it needs to add an

Imports MS.Internal.Xaml.Builtins

to every auto-generated XAML partial class (= the nameOfXamlFile.g.vb files), resulting in the following warning:

warning BC40056: Namespace or type specified in the Imports 'MS.Internal.Xaml.Builtins' 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.

I can remove the Imports line, but, since this is an auto-generated file, it reappears every time that the project is rebuilt.

This warning message is annoying and clutters my error list. Is ther something that can be done about it? Or is it a known bug?

Best Answer

I recently ran into this bug myself in one of my WPF projects. I compared references to a project that didn't have these problems and found that my project that was having the problem had these libraries referenced:

Microsoft.Windows.Design
Microsoft.Windows.Design.Extensibility
Microsoft.Windows.Design.Interaction
Microsoft.Windows.Design.Markup

I deleted these references and sure enough, the warnings went away.

Related Topic