4

In visual studio 2010 under the test settings < data and diagnostics tab < configuration for Code Coverage you can choose whether to instrument assemblies in place when you select which assemblies you wish to apply code coverage analysis to.

By default instrument assemblies in place is checked, however when it is checked anytime I run my unit tests I will be told there is no code coverage xml file being generated. If I choose to not instrument assemblies in place it works fine.

What gives?

4

1 回答 1

2

选项之间的基本区别是:

  • 就地检测:二进制文件在 VS 构建它们的目录中检测。
  • 否则:二进制文件在被复制后在测试部署目录中进行检测。构建目录中的二进制文件保持不变。

您是否有任何移动二进制文件的构建后脚本?根据项目引用、测试部署项和构建脚本,可能是在“就地”情况下,VS 正在检测运行单元测试时实际上并未部署的二进制文件。

于 2010-12-10T23:03:53.413 回答