Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
WPF性能套件引发BadImageFormatException_Wpf - Fatal编程技术网

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的示例应用程序。