Why don't I get code coverage results for C++/CLI project in Visual Studio 2010?

我与影子孤独终老i 提交于 2020-01-06 16:22:20

问题


I've recently upgrade my solution to Visual Studio 2010.

I have 4 projects I want to cover using unit tests - 3 C# and 1 C++/CLI.

I get coverage for the C# projects but not for the C++/CLI project.

I did get for all of them in Visual Studio 2008.

I've configured the assemblies using testrunconfig -> Data and Diagnostics -> Code Coverage -> Configure.

Why don't I get code coverage result for the C++/CLI project?


回答1:


I've found out what was wrong.

It appears that the upgrade from Visual Studio 2008 to Visual Studio 2010 removed the profile option (/PROFILE).

What was needed to be done was to go to

Project Properties -> Configuration Properties -> Linker -> Advanced -> Profile

and change this settings to Yes (/PROFILE).

Now I get code coverage for the C++/CLI project.



来源:https://stackoverflow.com/questions/2872158/why-dont-i-get-code-coverage-results-for-c-cli-project-in-visual-studio-2010

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!