0

I'm trying to get Code Coverage for a dotnet core application through manual testing (I don't have any unit tests project)

As mentioned in this SO Question, I'm trying to use vsinstr for instrumentation and vsperfmon.

But when running the below command

vsinstr /coverage C:\Test\netcoreapp2.0\ConsoleAppCodeCoverageTest.dll

I get the below error.

Microsoft (R) VSInstr Post-Link Instrumentation 15.0.27128 x86
Copyright (C) Microsoft Corp. All rights reserved.

File to Process:
   C:\Test\netcoreapp2.0\ConsoleAppCodeCoverageTest.dll --> 
C:\Test\netcoreapp2.0\ConsoleAppCodeCoverageTest.dll
Original file backed up to 
C:\Test\netcoreapp2.0\ConsoleAppCodeCoverageTest.dll.orig

Error VSP1019: Internal error.  HRESULT=80004005

But if I use vsinstr on a .Net Framework application exe it works fine.

Any idea how to fix this of if there is any other approach to get code coverage for a dotnet core application through manual testing.

Baga
  • 1,354
  • 13
  • 24

1 Answers1

0

Currently you have to be running Visual Studio Enterprise and it only works on Windows.

Related github issue.

If that isn't a problem for you, note these instructions:

If you are working from within VS on tests targeting .NET Core, then you will need to add a reference to the Microsoft.CodeCoverage NuGet package to your test project, and update both the test and app-under-test projects to generate ‘Full’ debug info.

More details here.

McGuireV10
  • 9,572
  • 5
  • 48
  • 64
  • Thanks! We don't have any unit test projects. We are trying to get code coverage when testing the application manually. – Baga Mar 12 '18 at 06:42