首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >WPF Performance Suite抛出BadImageFormatException

WPF Performance Suite抛出BadImageFormatException
EN

Stack Overflow用户
提问于 2013-05-06 18:26:51
回答 1查看 355关注 0票数 1

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

它抱怨有一个较新的运行时,所以我在exe上运行corflags来检查运行时版本。上面写着:

代码语言:javascript
复制
Version   : v4.0.30319
CLR Header: 2.5
PE        : PE32
CorFlags  : 1
ILONLY    : 1
32BIT     : 0
Signed    : 0

怎么了?为什么我无法在探查器中打开此WPF应用程序?

更新

尝试了JeffRSon的建议,这产生了另一个例外:

代码语言:javascript
复制
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()
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-05-07 20:51:13

C:\Program Files\Microsoft Windows Performance Toolkit\WPF Performance Suite中或安装了WPF Performance Suite的任何位置创建名为WpfPerf_managed.exe.config的文件,其中包含以下内容:

代码语言:javascript
复制
<?xml version="1.0"?>
<configuration>
   <startup useLegacyV2RuntimeActivationPolicy="true">
      <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
   </startup>
</configuration>

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

重新启动WPF Performance Suite并加载程序集。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16396740

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档