Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XAML Error for Visual Studio 2013

I'm trying to build my project and I keep getting these error messages:

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'. C:\Users\Geoff\Git\My Shopping List\My Shopping List\RunWindowItemList.xaml.cs 24 26 My Shopping List

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. C:\Users\Geoff\Git\My Shopping List\My Shopping List\obj\Debug\RunWindowItemList.g.cs 40 91 My Shopping List

I tried looking up on MSDN how to remedy the situation, but I haven't found anything. If anyone can help me with a solution or an article that has the solution, I would appreciate it!

like image 833
Uchiha Itachi Avatar asked Dec 13 '16 04:12

Uchiha Itachi


People also ask

How do I find the XAML code in Visual Studio?

To open the XAML Designer, right-click a XAML file in Solution Explorer and choose View Designer. to switch which window appears on top: either the artboard or the XAML editor.

How do I get rid of errors in Visual Studio?

You can change this behavior by going to Tools -> Options -> Projects and Solutions -> General and deselecting the "Always show Error List if build finishes with errors".


2 Answers

I had the same problem and after adding System.Xaml.dll to my References the problem resolved!

like image 131
Ehsan Avatar answered Nov 06 '22 08:11

Ehsan


Check version of System.Xaml.dll used in your project and compare to .net version of this project. Seems you use old version System.Xaml.dll. You can find other dll in folder C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework

like image 10
Vadzim Avatar answered Nov 06 '22 08:11

Vadzim