相关疑难解决方法(0)

使用PresentationFramework.Aero时,是否需要将"Copy Local"设置为true(并将其包含在我的安装项目中)?

我的WPF项目使用.NET 4客户端配置文件.当我添加

<ResourceDictionary Source="/PresentationFramework.Aero;component/themes/Aero.NormalColor.xaml" />
Run Code Online (Sandbox Code Playgroud)

<Application.Resources>在调试模式下启动程序,当我得到这个异常(在释放模式程序崩溃默默)

PresentationFramework.dll中出现'System.Windows.Markup.XamlParseException'类型的第一次机会异常

附加信息:'Set property'System.Windows.ResourceDictionary.Source'引发了一个异常.行号'14'和行位置'14'.

当我将PresentationFramework.Aero的属性"Copy Local"设置为true时,一切正常,异常就消失了.

"Copy Local"会在我的输出目录中放置PresentationFramework.Aero的副本,因此我需要将它包含在我的安装项目中.为什么这有必要?根据MSDN PresentationFramework.aero包含在.NET framework 4.0客户端配置文件中,因此也包含在GAC中.我觉得在我的应用程序中部署框架文件感觉不舒服.

UDATE:

正如Hans Passant建议我验证目录PresentationFramework.Aero存在于C:\windows\microsoft.net\assembly\gac_msil.然后我使用fuslogvw.exe生成以下日志,在启动我的应用程序"SetACL Studio.exe"时创建,而ApplicationFramework.Aero.dll不在应用程序目录中.有趣的是,加载器甚至没有检查GAC.为什么?

*** Assembly Binder Log Entry  (18.11.2011 @ 17:13:27) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable  D:\Daten\Helge\Programmierung\SetACL Studio\Source\Bin\Debug\SetACL Studio.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: User = HKT520\Helge
LOG: …
Run Code Online (Sandbox Code Playgroud)

.net wpf gac

11
推荐指数
1
解决办法
1万
查看次数

标签 统计

.net ×1

gac ×1

wpf ×1