OpenCover-找不到PDB [英] OpenCover - cannot find PDB
问题描述
我在使OpenCover正常工作时遇到问题
I am having some trouble getting OpenCover to work
我具有以下文件夹结构
- \工具
- \ Tools \ Nunit
- \ Tools \ OpenCover
- \ Buildartifacts
编译我的代码时,所有编译后的代码都会生成到BuildArtifacts文件夹中.这包括dll和相应的.pdb文件
When my code compiles, all the compiled code is generated into the BuildArtifacts folder. This includes the dll's and corresponding .pdb files
我正在努力让OpenCover运行
I am struggling to get OpenCover to run
从powershell中,我从根文件夹中输入以下命令:
From powershell I am entering the following command from the root folder:
.\ tools \ OpenCover \ OpenCover.Console.exe-注册:用户 -target:.\ tools \ nunit \ nunit-console.exe -targetargs:.\ buildartifacts \ MVCControllerTests.dll/noshadow" -filter:+ [*] * -output:.\ coverage.xml
.\tools\OpenCover\OpenCover.Console.exe -register:user -target:.\tools\nunit\nunit-console.exe -targetargs:".\buildartifacts\MVCControllerTests.dll /noshadow" -filter:+[*]* -output:.\coverage.xml
不过,我一直收到以下消息: 正在提交...
However I keep getting the message: Committing...
无结果-没有与提供的过滤器匹配的程序集 仪器化的 这可能是由于缺少与过滤器匹配的程序集的PDB 请查看输出文件并参考使用指南(Usage.rtf)
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)
我查看了 OpenCover/NUnit找不到PDB文件 ,并且我的targetargs中存在/noshadow开关
I have looked at OpenCover/NUnit can't find PDB files, and I have the /noshadow switch present in my targetargs
我试图将/noshadow移到targetargs中的第一个位置,但是随后我从nunit中得到了错误
I attempted to move /noshadow to be the first in the targetargs, but then I get errors from nunit
我还更新了nunit-console.exe.config并将以下行添加到启动节点,以确保所有测试均在.net4而不是.net3.5中执行
I have also updated nunit-console.exe.config and added the following line to the startup node to ensure that all the tests are executed within .net4 instead of .net3.5
< supportedRuntime version ="v4.0.30319">
<supportedRuntime version="v4.0.30319">
但这没什么区别.
当我查看coverage.xml文件时,即使我有noshadow标志,它仍然显示nunit正在进行卷影复制
When I viewed coverage.xml file, even though I had the noshadow flag, it still appears that nunit is doing a shadowcopy
例如,这存在:
C:\ Users \ darren \ AppData \ Local \ Temp \ nunit20 \ ShadowCopyCache \ 10344_634940293912912865718 \ Tests_275832668 \ assembly \ dl3 \ db34ecee \ a0f236ee_a7f4cd01 \ TABusinessInterface.DLL
C:\Users\darren\AppData\Local\Temp\nunit20\ShadowCopyCache\10344_634940293912865718\Tests_275832668\assembly\dl3\db34ecee\a0f236ee_a7f4cd01\TABusinessInterface.DLL
感谢任何帮助.
推荐答案
OpenCover WIKI 注意,在使用PowerShell时,应将整个参数用引号引起来,即
The OpenCover WIKI notes that when using PowerShell you should wrap the whole argument in quotes i.e.
-targetargs:".\buildartifacts\MVCControllerTests.dll /noshadow"
成为
"-targetargs:.\buildartifacts\MVCControllerTests.dll /noshadow"
这篇关于OpenCover-找不到PDB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!