为什么我不能在Visual Studio 2010中获取C ++ / CLI项目的代码覆盖结果?
我最近将我的解决方案升级到Visual Studio 2010。
I've recently upgrade my solution to Visual Studio 2010.
我有4个项目我想使用单元测试 - 3 C#和1 C ++ / CLI。
I have 4 projects I want to cover using unit tests - 3 C# and 1 C++/CLI.
我获得了C#项目的覆盖,但不是C ++ / CLI项目的覆盖。
I get coverage for the C# projects but not for the C++/CLI project.
所有这些都在Visual Studio 2008中。
I did get for all of them in Visual Studio 2008.
我已经使用testrunconfig - >数据和诊断 - >代码覆盖 - >配置配置了程序集。
I've configured the assemblies using testrunconfig -> Data and Diagnostics -> Code Coverage -> Configure.
为什么我不能获得C ++ / CLI项目的代码覆盖结果?
Why don't I get code coverage result for the C++/CLI project?
我发现了什么错误。
似乎从Visual Studio 2008到Visual Studio 2010的升级删除了配置文件选项( / PROFILE
It appears that the upgrade from Visual Studio 2008 to Visual Studio 2010 removed the profile option (/PROFILE
).
需要做的是转到
项目属性 - >配置属性 - >链接器 - >高级 - >配置文件
并将此设置更改为是( / PROFILE
)。
and change this settings to Yes (/PROFILE
).
现在我得到C ++ / CLI项目的代码覆盖率。
Now I get code coverage for the C++/CLI project.