dotnet test fails with `Could not resolve coreclr path` error
Steps to reproduce
dotnet test standalone test project
Expected behavior
Test runs fine
Actual behavior
Error is printed:
Could not resolve coreclr path
Environment data
dotnet --info output:
.NET Command Line Tools (1.0.0-rc2-002339)
Product Information:
Version: 1.0.0-rc2-002339
Commit Sha: 2be5e84f87
Runtime Environment:
OS Name: Windows
OS Version: 6.3.9600
OS Platform: Windows
RID: win81-x64
More data (deps file, log, command)
https://gist.github.com/pakrym/97eeb56dbe5bd30a4d04b4d7a40f3cc7
@muratg @Eilon @pranavkm
Blocks ASP.NET taking net CLI
/cc @schellap @brthor
@brthor, only the muxer gets --runtimeconfig right? Why is corehost using --runtimeconfig?
please share project.json of the test app.
https://github.com/aspnet/MusicStore/blob/dev/test/MusicStore.Test/project.json
Please give this a try:
{
"compilationOptions": {
"warningsAsErrors": true
},
"dependencies": {
"Microsoft.Extensions.Logging.Testing": "1.0.0-*",
"MusicStore": "1.0.0-*",
"XUnit": "2.1.0"
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dnxcore50",
"portable-net451+win8"
],
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-*",
"dotnet-test-xunit": "1.0.0-dev-*"
}
},
"net451": {}
},
"testRunner": "xunit"
}
Chatted with Senthil, and his PR dotnet/cli#2392 should fix the issue you are seeing.
The project.json changes I mentioned shouldn't be necessary but I would still recommend them.
@pakrym did this fix??
@piotrpMSFT, --runtimeconfig was added only for the muxer in exec mode because it was needed only for portable apps. It is also used with corehost.exe which it doesn't understand and hence doesn't read the deps file argument.
Having:
{
"compilationOptions": {
"warningsAsErrors": true
},
"dependencies": {
"Microsoft.Extensions.Logging.Testing": "1.0.0-*",
"MusicStore": "1.0.0-*",
"XUnit": "2.1.0"
},
"frameworks": {
"netcoreapp1.0": {
"imports": ["netstandardapp1.5",
"dnxcore50",
"portable-net451+win8"
],
"dependencies": {
"NETStandard.Library": "1.5.0-*",
"dotnet-test-xunit": "1.0.0-dev-*"
}
},
"net451": {}
},
"testRunner": "xunit"
}
didn't help.
@pakrym Are you able to try against dotnet/cli#2392, if --runtimeconfig is the issue, that PR has the right fix?
https://github.com/dotnet/cli/pull/2422 should solve the issue. I will test it once the bits show up