为什么我不能在Visual Studio 2010中获取C ++ / CLI项目的代码覆盖结果? [英] Why don't I get code coverage results for C++/CLI project in Visual Studio 2010?

查看:191
本文介绍了为什么我不能在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.

我已经使用testrunco​​nfig - >数据和诊断 - >代码覆盖 - >配置配置了程序集。

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.

这篇关于为什么我不能在Visual Studio 2010中获取C ++ / CLI项目的代码覆盖结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆