sdk icon indicating copy to clipboard operation
sdk copied to clipboard

dotnet test fails with `Could not resolve coreclr path` error

Open pakrym opened this issue 10 years ago • 11 comments

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

pakrym avatar Apr 11 '16 18:04 pakrym

/cc @schellap @brthor

pakrym avatar Apr 11 '16 18:04 pakrym

@brthor, only the muxer gets --runtimeconfig right? Why is corehost using --runtimeconfig?

schellap avatar Apr 11 '16 19:04 schellap

please share project.json of the test app.

brthor avatar Apr 11 '16 19:04 brthor

https://github.com/aspnet/MusicStore/blob/dev/test/MusicStore.Test/project.json

pakrym avatar Apr 11 '16 19:04 pakrym

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"
}

brthor avatar Apr 11 '16 19:04 brthor

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.

brthor avatar Apr 11 '16 19:04 brthor

@pakrym did this fix??

TheRealPiotrP avatar Apr 11 '16 19:04 TheRealPiotrP

@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.

schellap avatar Apr 11 '16 19:04 schellap

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 avatar Apr 11 '16 19:04 pakrym

@pakrym Are you able to try against dotnet/cli#2392, if --runtimeconfig is the issue, that PR has the right fix?

brthor avatar Apr 11 '16 20:04 brthor

https://github.com/dotnet/cli/pull/2422 should solve the issue. I will test it once the bits show up

krwq avatar Apr 12 '16 19:04 krwq