问题
I am using OpenCover 4.7.922 with nUnit console runner 3.10.0.
I have a myproj.tests
project which tests myproj
.
After building, myproj.tests\bin\debug
contains myproj.tests.dll
, myproj.tests.pdb
, myproj.dll
, myproj.pdb
.
myproj
is registered in the GAC.
I am calling OpenCover like so:
OpenCover.Console.exe -output:opencover.xml -register:user -target:"nunit3-console.exe" -targetargs:"myproj.tests\bin\debug\myproj.tests.dll --result=NUnitResults.xml"
opencover.xml
contains
<Module skippedDueTo="MissingPdb" hash="DD-83-09-69-9F-A7-11-FF-F5-BC-43-7C-87-B2-54-99-0D-A5-D5-61">
<ModulePath>C:\Windows\Microsoft.Net\assembly\GAC_MSIL\myproj\v4.0_1.0.0.0__bf95fa7f15863c9f\myproj.dll</ModulePath>
<ModuleTime>2019-09-05T16:07:28.6111533Z</ModuleTime>
<ModuleName>myproj</ModuleName>
<Classes />
</Module>
Which I believe shows OpenCover is looking in the GAC for the PDB even though it is right there in the same folder as the dll specified in targetargs
.
I have tried setting -targetdir
and -searchdirs
to the myproj.tests\bin\debug
folder (which contains the dll and pdb files) but this didn't make any changes to opencover.xml
Can I tell OpenCover to look in a specific location (not GAC) for the PDB? or will I have to unregister from the GAC then run OpenCover?
来源:https://stackoverflow.com/questions/57820146/how-to-get-opencover-to-look-at-local-bin-debug-folder-for-pdbs-not-gac