Sha*_*aku 9 .net c# wpf xaml resourcedictionary
创建一个名为的新WPF项目: 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"/>
Run Code Online (Sandbox Code Playgroud)
这样做会显示警告
Assembly 'PresentationFramework.Aero,Version=4.0.0.0,Culture=Neutral,PublicKeyToken=31bf3856ad364e35,processorArchitecture=MSIL' is not referenced by this project
Run Code Online (Sandbox Code Playgroud)
我已经仔细检查以确保版本实际上4.0.0.0并且PublicKeyToken实际上是31bf3856ad364e35通过导航到C:\Windows\Microsoft.NET\assembly\GAC_MSIL\PresentationFramework.Aero以及在运行时通过查看来自的AssemblyInfo来检查GACAppDomain.CurrentDomain.GetAssemblies();
有没有办法解决这个警告?这是WPF Windows 8兼容性问题的后续问题
小智 2
通常,在使用程序集中的资源时,不需要指定程序集版本、区域性和键。以下示例编译时没有任何警告:
<ResourceDictionary Source="/PresentationFramework.Aero;component/themes/Aero.NormalColor.xaml"/>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2699 次 |
| 最近记录: |