如何在x64窗口中运行PartCover

时间:2022-08-26 19:51:31

I am trying to run PartCover to test the coverage of some tests with Gallio on windows x64. However trying to run it gives the following error.

我正在尝试运行PartCover来测试在Windows x64上使用Gallio进行的一些测试的覆盖范围。但是,尝试运行它会产生以下错误。

Retrieving the COM class factory for component with CLSID {FB20430E-CDC9-45D7-8453-272268002E08} failed due to the following error: 80040153.

由于以下错误,检索具有CLSID {FB20430E-CDC9-45D7-8453-272268002E08}的组件的COM类工厂失败:80040153。

Edit: I am using PartCover 2.2.0

编辑:我正在使用PartCover 2.2.0

1 个解决方案

#1


17  

The problem is caused by PartCover trying to load a 32 bit dll when it is running under the 64-bit .NET VM.

问题是由PartCover在64位.NET VM下运行时尝试加载32位dll引起的。

The trick is to force PartCover to run in the 32 bit VM. In order to do this you have to use a tool called CorFlags.exe to modify the exe and flag it as 32 bit. This is equivalent to it having been built with x86 as its target.

诀窍是强制PartCover在32位VM中运行。为此,您必须使用名为CorFlags.exe的工具来修改exe并将其标记为32位。这相当于它以x86为目标构建。

CorFlags (on my machine) is in Program Files\Microsoft SDKs\Windows\v6.0A\Bin\x64\

CorFlags(在我的机器上)位于Program Files \ Microsoft SDKs \ Windows \ v6.0A \ Bin \ x64 \

To set the 32-bit flag run:

要设置32位标志运行:

CorFlags.exe PartCover.exe /32BIT+ /Force

CorFlags.exe PartCover.exe / 32BIT + / Force

I also found that I had to do the same for the program being run (in my case the Gallio test runner)

我还发现我必须为正在运行的程序做同样的事情(在我的情况下是Gallio测试运行器)

#1


17  

The problem is caused by PartCover trying to load a 32 bit dll when it is running under the 64-bit .NET VM.

问题是由PartCover在64位.NET VM下运行时尝试加载32位dll引起的。

The trick is to force PartCover to run in the 32 bit VM. In order to do this you have to use a tool called CorFlags.exe to modify the exe and flag it as 32 bit. This is equivalent to it having been built with x86 as its target.

诀窍是强制PartCover在32位VM中运行。为此,您必须使用名为CorFlags.exe的工具来修改exe并将其标记为32位。这相当于它以x86为目标构建。

CorFlags (on my machine) is in Program Files\Microsoft SDKs\Windows\v6.0A\Bin\x64\

CorFlags(在我的机器上)位于Program Files \ Microsoft SDKs \ Windows \ v6.0A \ Bin \ x64 \

To set the 32-bit flag run:

要设置32位标志运行:

CorFlags.exe PartCover.exe /32BIT+ /Force

CorFlags.exe PartCover.exe / 32BIT + / Force

I also found that I had to do the same for the program being run (in my case the Gallio test runner)

我还发现我必须为正在运行的程序做同样的事情(在我的情况下是Gallio测试运行器)