创建一个名为:xmlnsError
添加对 PresentationFramework.Aero
的引用
将此 ResourceDictionary
添加到 App.xaml
:
<ResourceDictionary Source="/PresentationFramework.Aero,Version=4.0.0.0,Culture=Neutral,PublicKeyToken=31bf3856ad364e35,processorArchitecture=MSIL;component/themes/Aero.NormalColor.xaml"/>
这样做会显示警告
Assembly 'PresentationFramework.Aero,Version=4.0.0.0,Culture=Neutral,PublicKeyToken=31bf3856ad364e35,processorArchitecture=MSIL' is not referenced by this project
我已通过导航到 C:\Windows 仔细检查以确保版本实际上是
以及通过查看来自 4.0.0.0
并且 PublicKeyToken 实际上是 31bf3856ad364e35
\Microsoft.NET\assembly\GAC_MSIL\PresentationFramework.AeroAppDomain.CurrentDomain.GetAssemblies();
有什么办法可以解决这个警告吗?这是 WPF Windows 8 Compatability Issue 的后续问题
最佳答案
通常情况下,在使用程序集中的资源时不需要指定程序集版本、区域性和 key 。以下示例编译时没有任何警告:
<ResourceDictionary Source="/PresentationFramework.Aero;component/themes/Aero.NormalColor.xaml"/>
关于c# - "Assembly is not referenced by this project"WPF资源字典错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22622717/