我需要分析我的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应用程序?
更新
尝试了JeffRSon的建议,这产生了另一个例外:
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()发布于 2013-05-07 20:51:13
在C:\Program Files\Microsoft Windows Performance Toolkit\WPF Performance Suite中或安装了WPF Performance Suite的任何位置创建名为WpfPerf_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并加载程序集。
https://stackoverflow.com/questions/16396740
复制相似问题