“Assembly does not reference this project” Error in WPF Resource Dictionary

Create a new WPF project called: xmlnsError

Add link 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"/> 

A warning is displayed.

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

I checked twice to make sure that the version is actually 4.0.0.0 , and the PublicKeyToken is actually 31bf3856ad364e35 , moving to C:\Windows\Microsoft.NET\assembly\GAC_MSIL\PresentationFramework.Aero , and also checking the GAC at runtime. by looking at AssemblyInfo with AppDomain.CurrentDomain.GetAssemblies();

Is there any way to fix this warning? This is the next question. Windows 8 WPF Compatibility Problem

+8
c # wpf xaml resourcedictionary
source share
2 answers

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

 <ResourceDictionary Source="/PresentationFramework.Aero;component/themes/Aero.NormalColor.xaml"/> 
+2
source share

Apparently (MSDN Forums) , there is only a version of Aero metadata, and the right one is in C:\Windows\Microsoft.NET\Framework\v4.0.30319\WPF . I have no way to check if there was a similar problem / solution for any version of .NET 4.5 at the moment.

0
source share

All Articles