Question

below is the Line of code I am writing to execute open Cover

<Target Name="Build">
     <!--NUnit-->
    <Exec Command="...\WcfServiceLibrary1\thirdparty\tools\NUnit\nunit-console-x86.exe ...\WcfServiceLibrary1\UnitTestProject1\bin\Debug\UnitTestProject1.dll /xml=...\WcfServiceLibrary1\TestResult.xml" />
    <!--Open Cover-->
    <Exec Command="...\WcfServiceLibrary1\thirdparty\tools\OpenCover\OpenCover.console.exe -register:user -target:...\WcfServiceLibrary1\thirdparty\tools\NUnit\nunit-console-x86.exe -targetargs:...\WcfServiceLibrary1\UnitTestProject1\bin\Debug\UnitTestProject1.dll /noshadow -output:...\WcfServiceLibrary1\Coverage.xml" />
 <!--Report generator-->
<Exec Command="...\WcfServiceLibrary1\thirdparty\tools\OpenCover\CoverageReport\ReportGenerator.exe -reports:mycoveragereport.xml -targetdir:...\WcfServiceLibrary1\mycoveragereport.xml" />
  </Target>

Now the Coverage Report That I am getting is having missing PDB's statement

<?xml version="1.0" encoding="utf-8"?>
<CoverageSession xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Summary numSequencePoints="0" visitedSequencePoints="0" numBranchPoints="0" visitedBranchPoints="0" sequenceCoverage="0" branchCoverage="0" maxCyclomaticComplexity="0" minCyclomaticComplexity="0" />
  <Modules>
    <Module skippedDueTo="Filter" hash="B5-EF-91-87-52-88-4E-B0-F8-8C-F4-4C-97-10-C8-D0-C0-7E-55-19">
      <FullName>C:\Windows\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll</FullName>
      <ModuleName>mscorlib</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="Filter" hash="F9-04-A8-31-CD-FB-23-72-95-63-5D-14-9A-A0-66-8E-7F-44-93-7A">
      <FullName>C:\Windows\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\sorttbls.nlp</FullName>
      <ModuleName>mscorlib</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="MissingPdb" hash="DD-C7-B8-46-28-B0-4A-0B-84-CB-A2-DD-7F-EC-4A-98-75-61-4C-17">
      <FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\nunit-console-x86.exe</FullName>
      <ModuleName>nunit-console-x86</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="Filter" hash="6E-30-2E-50-36-FB-60-2C-8E-50-C0-83-54-8B-CC-EA-A8-91-B6-CC">
      <FullName>C:\Windows\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\sortkey.nlp</FullName>
      <ModuleName>mscorlib</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="MissingPdb" hash="79-F8-9A-22-4E-29-52-37-00-CF-81-FF-1F-EA-05-EC-74-2A-2E-C8">
      <FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\lib\nunit-console-runner.dll</FullName>
      <ModuleName>nunit-console-runner</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="MissingPdb" hash="23-35-8C-86-05-D5-AE-FE-3C-1F-09-A0-86-02-40-7C-4F-CA-59-41">
      <FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\lib\nunit.core.dll</FullName>
      <ModuleName>nunit.core</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="MissingPdb" hash="57-DD-20-42-DA-33-B3-EE-DA-8C-8E-25-C9-E5-07-B5-08-62-0F-88">
      <FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\lib\nunit.util.dll</FullName>
      <ModuleName>nunit.util</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="MissingPdb" hash="AD-76-2F-3C-5E-F6-77-0D-C6-AD-AF-A3-90-85-28-07-2D-A0-59-50">
      <FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\lib\nunit.core.interfaces.dll</FullName>
      <ModuleName>nunit.core.interfaces</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="Filter" hash="2C-99-EE-29-D5-25-03-C4-0E-40-26-9B-F7-DF-C2-68-6E-74-74-31">
      <FullName>C:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll</FullName>
      <ModuleName>System.Configuration</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="Filter" hash="D3-99-70-9D-4C-FD-70-CC-82-00-AA-75-7A-54-8C-25-AC-54-B1-BF">
      <FullName>C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll</FullName>
      <ModuleName>System</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="Filter" hash="C4-AD-0A-97-FF-1D-61-5F-88-89-A6-25-BD-02-5E-E5-F5-1D-6F-20">
      <FullName>C:\Windows\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll</FullName>
      <ModuleName>System.Xml</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="Filter" hash="92-44-10-37-4C-84-2D-65-E3-A0-6A-B9-9F-01-42-6A-27-41-4A-8C">
      <FullName>C:\Windows\assembly\GAC_MSIL\System.Runtime.Remoting\2.0.0.0__b77a5c561934e089\System.Runtime.Remoting.dll</FullName>
      <ModuleName>System.Runtime.Remoting</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="Filter" hash="94-1E-7C-FB-9C-23-D5-E1-43-03-B3-3C-0B-35-BB-9A-83-CC-9B-65">
      <FullName>C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll</FullName>
      <ModuleName>mscorlib</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="MissingPdb" hash="6D-DC-5C-CD-CD-17-D8-34-8A-02-0A-F6-CB-BC-84-81-BD-88-CB-86">
      <FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\nunit-agent-x86.exe</FullName>
      <ModuleName>nunit-agent-x86</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="MissingPdb" hash="23-35-8C-86-05-D5-AE-FE-3C-1F-09-A0-86-02-40-7C-4F-CA-59-41">
      <FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\lib\nunit.core.dll</FullName>
      <ModuleName>nunit.core</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="MissingPdb" hash="57-DD-20-42-DA-33-B3-EE-DA-8C-8E-25-C9-E5-07-B5-08-62-0F-88">
      <FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\lib\nunit.util.dll</FullName>
      <ModuleName>nunit.util</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="MissingPdb" hash="AD-76-2F-3C-5E-F6-77-0D-C6-AD-AF-A3-90-85-28-07-2D-A0-59-50">
      <FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\lib\nunit.core.interfaces.dll</FullName>
      <ModuleName>nunit.core.interfaces</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="Filter" hash="98-5B-33-BC-92-AB-DB-88-FE-EC-F2-8F-04-5B-06-B6-ED-05-0B-00">
      <FullName>C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll</FullName>
      <ModuleName>System</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="Filter" hash="84-64-E1-D2-0A-E2-91-23-AD-BD-B9-7A-3C-89-7B-66-65-58-46-1C">
      <FullName>C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Remoting\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Remoting.dll</FullName>
      <ModuleName>System.Runtime.Remoting</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="Filter" hash="E3-30-C9-0B-9B-B1-9B-30-08-04-31-DB-0F-94-7C-B3-A9-8B-5B-75">
      <FullName>C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll</FullName>
      <ModuleName>System.Configuration</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="Filter" hash="A0-AB-0F-DB-C8-A9-ED-50-B7-8B-8A-F2-59-CF-35-5E-E5-F6-78-AF">
      <FullName>C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll</FullName>
      <ModuleName>System.Xml</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="Filter" hash="7E-B6-09-DE-71-47-47-2D-10-E4-4A-18-28-FB-3D-17-16-8C-88-6D">
      <FullName>C:\Windows\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll</FullName>
      <ModuleName>System.Web</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="Filter" hash="9F-62-A2-66-54-66-BC-CE-FD-0D-1B-20-6E-F7-50-CC-76-C2-6F-D4">
      <FullName>C:\Windows\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll</FullName>
      <ModuleName>System.Web</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="MissingPdb" hash="23-35-8C-86-05-D5-AE-FE-3C-1F-09-A0-86-02-40-7C-4F-CA-59-41">
      <FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\lib\nunit.core.dll</FullName>
      <ModuleName>nunit.core</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="Filter" hash="98-5B-33-BC-92-AB-DB-88-FE-EC-F2-8F-04-5B-06-B6-ED-05-0B-00">
      <FullName>C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll</FullName>
      <ModuleName>System</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="MissingPdb" hash="C8-69-A6-5A-0E-1E-E0-29-EB-EF-CA-C5-2C-E2-B7-EB-F6-D9-64-1A">
      <FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\pnunit.framework.dll</FullName>
      <ModuleName>pnunit.framework</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="MissingPdb" hash="F9-30-3E-D0-DF-D4-B8-50-24-2D-CB-99-08-61-9C-77-28-1C-6D-29">
      <FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\pnunit-agent.exe</FullName>
      <ModuleName>pnunit-agent</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="MissingPdb" hash="AD-76-2F-3C-5E-F6-77-0D-C6-AD-AF-A3-90-85-28-07-2D-A0-59-50">
      <FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\lib\nunit.core.interfaces.dll</FullName>
      <ModuleName>nunit.core.interfaces</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="MissingPdb" hash="50-42-5D-72-64-97-F8-84-32-24-43-4B-DF-ED-F6-E0-13-A5-E5-0D">
      <FullName>...\AppData\Local\Temp\nunit20\ShadowCopyCache\4380_635168510637584953\Tests_111289631\assembly\dl3\f065302a\85aa24e8_1fc4ce01\UnitTestProject1.dll</FullName>
      <ModuleName>UnitTestProject1</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="MissingPdb" hash="13-4C-94-D1-A1-A5-D9-8F-F1-E4-CE-A7-87-EF-CC-42-FC-6B-CA-BC">
      <FullName>...\AppData\Local\Temp\nunit20\ShadowCopyCache\4380_635168510637584953\Tests_111289631\assembly\dl3\f468205a\003c8368_6cb0cd01\nunit.framework.dll</FullName>
      <ModuleName>nunit.framework</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="MissingPdb" hash="79-F8-9A-22-4E-29-52-37-00-CF-81-FF-1F-EA-05-EC-74-2A-2E-C8">
      <FullName>...\WcfServiceLibrary1\thirdparty\tools\NUnit\lib\nunit-console-runner.dll</FullName>
      <ModuleName>nunit-console-runner</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="Filter" hash="84-64-E1-D2-0A-E2-91-23-AD-BD-B9-7A-3C-89-7B-66-65-58-46-1C">
      <FullName>C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Remoting\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Remoting.dll</FullName>
      <ModuleName>System.Runtime.Remoting</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="Filter" hash="E3-30-C9-0B-9B-B1-9B-30-08-04-31-DB-0F-94-7C-B3-A9-8B-5B-75">
      <FullName>C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll</FullName>
      <ModuleName>System.Configuration</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="Filter" hash="A0-AB-0F-DB-C8-A9-ED-50-B7-8B-8A-F2-59-CF-35-5E-E5-F6-78-AF">
      <FullName>C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll</FullName>
      <ModuleName>System.Xml</ModuleName>
      <Classes />
    </Module>
    <Module skippedDueTo="MissingPdb" hash="FF-78-B2-8E-E7-37-5C-12-16-D2-B5-9F-24-7A-E2-2D-4B-AC-F2-3D">
      <FullName>...\AppData\Local\Temp\nunit20\ShadowCopyCache\4380_635168510637584953\Tests_111289631\assembly\dl3\78ee3213\e91005a5_1fc4ce01\WcfServiceLibrary1.dll</FullName>
      <ModuleName>WcfServiceLibrary1</ModuleName>
      <Classes />
    </Module>
  </Modules>
</CoverageSession>

I have created the pdbs in the respective folders where the dlls are residing still cannot figure out why OpenCover is not able to find them. Please help. Thanks in advance

Was it helpful?

Solution

You either need to use /noshadow when executing nunit or you need to use -targetdir: with OpenCover.

Now I can see that you trying to use /noshadow but it looks like you may not have constructed your command line properly (it could just be wrong as you have modified it to hide paths and inadvertently edited it).

You need to use quotes to ensure all you arguments that you intend to send to nunit stay together but because you are using msbuild you need to escape them i.e.

<Exec Command="&quot;...\WcfServiceLibrary1\thirdparty\tools\OpenCover\OpenCover.console.exe&quot; -register:user &quot;-target:...\WcfServiceLibrary1\thirdparty\tools\NUnit\nunit-console-x86.exe&quot; &quot;-targetargs:...\WcfServiceLibrary1\UnitTestProject1\bin\Debug\UnitTestProject1.dll /noshadow&quot; &quot;-output:...\WcfServiceLibrary1\Coverage.xml&quot;" />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top