Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Assembly is not referenced by this project" Error in a WPF Resource Dictionary

Create a new WPF project called: xmlnsError

Add a reference to PresentationFramework.Aero

Add this ResourceDictionary to App.xaml:

<ResourceDictionary Source="/PresentationFramework.Aero,Version=4.0.0.0,Culture=Neutral,PublicKeyToken=31bf3856ad364e35,processorArchitecture=MSIL;component/themes/Aero.NormalColor.xaml"/>

Doing so shows a warning of

Assembly 'PresentationFramework.Aero,Version=4.0.0.0,Culture=Neutral,PublicKeyToken=31bf3856ad364e35,processorArchitecture=MSIL' is not referenced by this project

I've double-checked to make sure that the version is actually 4.0.0.0 and the PublicKeyToken is actually 31bf3856ad364e35 by navigating to C:\Windows\Microsoft.NET\assembly\GAC_MSIL\PresentationFramework.Aero as well as checking the GAC at runtime by looking at the AssemblyInfo from AppDomain.CurrentDomain.GetAssemblies();

Is there any way to fix this warning? This a follow-up question to WPF Windows 8 Compatability Issue

like image 707
Shaku Avatar asked Mar 24 '14 23:03

Shaku


1 Answers

Normally, you do not need to specify the assembly version, culture, and key when using resources from an assembly. The following example compiles without any warnings:

<ResourceDictionary Source="/PresentationFramework.Aero;component/themes/Aero.NormalColor.xaml"/>
like image 110
MattCat Avatar answered Oct 14 '22 04:10

MattCat