In VS 2010 created a new WinForm
project. Added a new UserControl WPF.
2 compile-time errors appeared:
Error 1 The type 'System.Windows.Markup.IQueryAmbient' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. D:\Projets\WindowsFormsApplication2\UserControl1.xaml.cs 20 26 WindowsFormsApplication2
Error 2 The type name 'IComponentConnector' could not be found in the namespace 'System.Windows.Markup'. This type has been forwarded to assembly 'System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' Consider adding a reference to that assembly. D:\Projets\WindowsFormsApplication2\obj\x86\Debug\UserControl1.g.cs 41 100 WindowsFormsApplication2
NB.
References like PresenationCore.dll
, PresenationFramework.dll
, WindowsBase.dll
are added automatically when adding a new WPF UserControl to the WinForm project, so why not System.Xaml.dll
too?
==============
Bug reported on Microsoft Connect.
Microsoft Visual Studio is an IDE made by Microsoft and used for different types of software development such as computer programs, websites, web apps, web services, and mobile apps. It contains completion tools, compilers, and other features to facilitate the software development process.
Visual Studio is a programming environment that is used to create software on Windows, rest assured, it is not a virus, it is genuine legitimate software.
Visual Studio Community. A fully-featured, extensible, free IDE for creating modern applications for Android, iOS, Windows, as well as web applications and cloud services.
it sounds like you just need a reference to System.Xaml.dll
Re whether this is a bug in VS; well, I suppose the templates could add that reference - I can reproduce it, so it may be worth logging on connect
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