Analyze Code Coverage in VS2015 not working
See original GitHub issueSteps to reproduce
When I create a test solution with a ClassLibrary project in the src folder, and a Test project in the test folder with the following project.json files, all tests/testrunners work just fine, but analyzing the code coverage in VS is not working.
ClassLibrary’s project.json:
{
"version": "1.0.0-*",
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-3002702"
}
}
},
"net452": { }
}
}
Test’s project.json:
{
"version": "1.0.0-*",
"testRunner": "xunit",
"dependencies": {
"xunit": "2.2.0-beta1-build3239",
"dotnet-test-xunit": "1.0.0-rc2-build10015",
"Test": "1.0.0-*"
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-3002702"
}
},
"imports": [
"dnxcore50",
"portable-net45+win8"
]
},
"net452": {
"dependencies": {
"Microsoft.NETCore.Platforms": "1.0.1-rc2-24027"
}
}
}
}
Expected behavior
To show me the code coverage.
Actual behavior
dotnet.exe has stopped working.
And the Tests output shows me: ------ Run test started ------ Discovering tests in ‘…\Test\Test\project.json’ [“C:\Program Files\dotnet\dotnet.exe” test “…\Test\Test\project.json” --output “…\Test\Test\bin\Debug\netcoreapp1.0” --port 8005 --parentProcessId 7116 --no-build] ‘test-xunit’ returned ‘-532462766’.
Environment data
dotnet --info
output:
.NET Command Line Tools (1.0.0-preview1-002702)
Product Information: Version: 1.0.0-preview1-002702 Commit Sha: 6cde21225e
Runtime Environment: OS Name: Windows OS Version: 6.1.7601 OS Platform: Windows RID: win7-x64
Issue Analytics
- State:
- Created 7 years ago
- Comments:9
Top GitHub Comments
Ok, my fault. See dotnet/sdk#5440
Simply add
"Microsoft.CodeCoverage": "1.0.1"
to the netcoreapp1.0 dependencies, and everything works fine.The Test’s project.json looks now like:
@jderus Try adding “imports” section with one of package’s supported TFM, e.g:
"imports": ["dnxcore50"]