问题
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