1

我需要分析我的WPF4.0 应用程序。当我尝试在WPF Performance Suite 4.0(从Windows SDK 7.1)中打开它时,它会抛出一个BadImageFormatException

在此处输入图像描述

它抱怨更新的运行时,所以我跑来corflags检查exe运行时版本。它说:

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()
4

1 回答 1

3

创建一个在 WPF Performance Suite 安装位置或安装位置调用的文件,其中包含以下内容WpfPerf_managed.exe.configC:\Program Files\Microsoft Windows Performance Toolkit\WPF Performance Suite

<?xml version="1.0"?>
<configuration>
   <startup useLegacyV2RuntimeActivationPolicy="true">
      <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
   </startup>
</configuration>

这可以在一个进程中实现并行运行时。

重新启动 WPF 性能套件并加载您的程序集。

于 2013-05-07T12:51:13.000 回答