WPF性能套件引发BadImageFormatException
我需要评测我的WPF性能套件引发BadImageFormatException,wpf,Wpf,我需要评测我的WPF4.0应用程序。当我尝试在WPF Performance Suite 4.0(来自Windows SDK 7.1)中打开它时,它会抛出一个BadImageFormatException: 它抱怨运行时更新,所以我在exe上运行corflags来检查运行时版本。它说: Version : v4.0.30319 CLR Header: 2.5 PE : PE32 CorFlags : 1 ILONLY : 1 32BIT : 0 Signed
WPF
4.0应用程序。当我尝试在WPF Performance Suite 4.0
(来自Windows SDK 7.1
)中打开它时,它会抛出一个BadImageFormatException
:
它抱怨运行时更新,所以我在exe
上运行corflags
来检查运行时版本。它说:
Version : v4.0.30319
CLR Header: 2.5
PE : PE32
CorFlags : 1
ILONLY : 1
32BIT : 0
Signed : 0
怎么了?为什么我不能在探查器中打开此WPF
应用程序
更新
尝试了杰弗森的建议,产生了另一个例外:
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
at Microsoft.WpfPerformance.ToolAssembly..ctor(Assembly assembly)
at Microsoft.WpfPerformance.Controls.AddToolDialog.ScanAssembly(String filename)
at Microsoft.WpfPerformance.Controls.AddToolDialog.ScanAssembly()
在
C:\Program Files\Microsoft Windows Performance Toolkit\WPF Performance Suite
中或安装了WPF Performance Suite的任何位置创建名为WpfPerf\u managed.exe.config的文件,并包含以下内容:
<?xml version="1.0"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
这允许在一个进程中并行运行
重新启动WPF Performance Suite并加载程序集。是否已检查WPF Performance Suite版本?AFAICT在安装SDK7.1时出现了更新问题,上面说的是4.0。嗯。我需要重新启动我的电脑才能工作吗?很有趣!然而,我却犯了另一个错误。请参阅我的最新问题。如果没有“一个或多个请求类型”的详细信息,很难说。你们有什么不寻常的地方吗?也许可以先尝试一些最低限度的实现?嗯。我正在使用MEF
来处理插件。是否在加载exe时当前目录设置不正确?可能。但目前我没有任何有用的想法。可能先尝试一些没有MEF的示例应用程序。