Code Coverage does not work even after adding the code coverage nuget.
See original GitHub issueSteps to reproduce
The attached project has a simple xunit test. There are two ways to repro this:
The more easier way of reproing this is : From a developer command prompt run vstest.console.exe project.json /useVsixExtensions:true /enableCodeCoverage
For the VS IDE repro you can use this:
- Open it in VS.
- Open Test Explorer.(Test -> Windows -> Test Explorer)
- Build the solution to trigger discovery.
- Right Click on the discovered test and “Analyze code coverage”
Expected behavior
A code coverage file that covers the project under test with no errors.
Actual behavior
The following error occurs: Error: Unable to start C:\Program Files\dotnet\bin\dotnet.exe
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly ‘Microsoft.VisualStudio.CodeCoverage.Shim, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified. at Microsoft.DotNet.Cli.Program.Main(String[] args)
This scenario works if I manually drop the CodeCoverage.Shim dll that the nuget package contains under %ProgramFiles%/dotnet/bin.
Environment data
dotnet --version
output:
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:7 (2 by maintainers)
Top GitHub Comments
Why is this issue closed if the problem is not solved?
System.IO.FileNotFoundException : Could not load file or assembly ‘Microsoft.VisualStudio.CodeCoverage.Shim, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’.
no work…