OpenCover / NUnit的找不到PDB文件 [英] OpenCover/NUnit can't find PDB files
问题描述
我用OpenCover http://nuget.org/packages/opencover 并采写下面的批处理文件来运行单元测试并生成code覆盖统计:
I'm using OpenCover http://nuget.org/packages/opencover and have written the following batch file to run the unit tests and generate code coverage stats:
echo off
echo ***************************
echo *** Running NUnit tests ***
echo ***************************
"..\packages\OpenCover.4.0.804\OpenCover.Console.exe" -register:user -target:"..\NUnit 2.6\bin\nunit-console-x86.exe" -targetargs:"..\Web.UnitTests\bin\Debug\Web.UnitTests.dll" -output:coverage.xml
echo **************************************
echo *** Generating coverage statistics ***
echo **************************************
"..\packages\ReportGenerator.1.6.0.0\ReportGenerator.exe" "-reports:coverage.xml" "-targetdir:%CD%"
echo ***********************************
echo *** Launching Internet Explorer ***
echo ***********************************
start "C:\Program Files (x86)\Internet Explorer\iexplore.exe" "%CD%\Index.htm"
pause
然而,当我运行该批处理文件出现错误:
However when I run the batch file I get the error:
Committing...
No results - no assemblies that matched the supplied filter were instrumented
this could be due to missing PDBs for the assemblies that match the filter
please review the output file and refer to the Usage guide (Usage.rtf)
pretty的肯定,我已经做了一些愚蠢/缺少明显的东西,但不知道是什么!
Pretty sure I've done something silly / missing something obvious, but not sure what!
在PDB文件夹中:.. \ Web.UnitTests \斌\调试\
The PDB files are in the folder: "..\Web.UnitTests\bin\Debug\"
鸭preciate任何帮助,
Appreciate any help,
谢谢
推荐答案
找到了解决办法,我错过了/ noshadow开关NUnit的。即目标的args应该是:
Found a solution, I was missing the /noshadow switch for nunit. I.e. the target args should be:
-targetargs:"..\Web.UnitTests\bin\Debug\Web.UnitTests.dll /noshadow"
作品完美了。
Works perfectly now.
这篇关于OpenCover / NUnit的找不到PDB文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!