runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Host is not adding "project" dependencies to TPA

Open schellap opened this issue 10 years ago • 0 comments

Steps to reproduce

dotnet new Edit project.json and remove type: platform to make it standalone

dotnet restore --infer-runtimes
dotnet publish
cd bin\Debug\netcoreapp1.0\win7-x64\publish

Replace "package" to "project" for the CoreCLR runtime reference in "libraries" section of app.deps.json

    "runtime.win7-x64.Microsoft.NETCore.Runtime.CoreCLR/1.0.2": {
      "type": "project",
      "serviceable": true,
      ...
    },

Expected behavior

temp\bin\Debug\netcoreapp1.0\win7-x64\publish>temp.exe
Hello World!

Actual behavior

temp\bin\Debug\netcoreapp1.0\win7-x64\publish>temp.exe
Could not resolve CoreCLR path. For more details, enable tracing by setting COREHOST_TRACE environment variable to 1

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-preview3-003161)

Product Information:
 Version:            1.0.0-preview3-003161
 Commit SHA-1 hash:  63846c5751

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.10586
 OS Platform: Windows
 RID:         win10-x64

Notes

  • This works in 1.0.0 because of dotnet/runtime#2453
  • This bug could cause problems if someone triggered a not yet loaded TPA assembly in a custom load context, but ignored the load override.
  • The bug is due to this if-check which should be removed.
    • https://github.com/dotnet/core-setup/blob/b25d39a8521942c70a91ca04210434ab626c292a/src/corehost/cli/deps_format.cpp#L38
    • https://github.com/dotnet/core-setup/blob/b25d39a8521942c70a91ca04210434ab626c292a/src/corehost/cli/deps_format.cpp#L71

Cc @gkhanna79 @brthor @anurse

schellap avatar Jun 25 '16 02:06 schellap