Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VisualStudio bug?

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.

like image 766
serhio Avatar asked Dec 08 '10 13:12

serhio


People also ask

What is Visual Studio used for?

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.

Is Visual Studio code virus?

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.

Is Microsoft Visualstudio free?

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.


1 Answers

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

like image 77
Marc Gravell Avatar answered Oct 09 '22 00:10

Marc Gravell