No code coverage data collected on dotnet test --collect "Code Coverage"
Add <DebugType>Embedded</DebugType> to default test project.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<DebugType>Embedded</DebugType>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.2.1" />
<PackageReference Include="MSTest.TestFramework" Version="1.2.1" />
</ItemGroup>
</Project>
dotnet test --collect "Code Coverage"Code coverage data should be collected
No code coverage data collected
Fix for this planned in VS 16.0
/cc @VCZYK
How's this coming?
Ping? What SDK/NuGet version is this in?
Any new information when this will be available?
We are waiting for that too.
It is enough to install newer version of Microsoft.CodeCoverage:
dotnet add package Microsoft.CodeCoverage --version 16.7.0
I will make sure that dotnet also uses newer version of this package. Currently it is installing 16.5.
It's enough to upgrade Microsoft.NET.Test.Sdk to 16.7.0 in csproj.
Most helpful comment
Any new information when this will be available?