dotnet publish should use host binaries from the project dependency graph
Steps to reproduce
md standalone
cd standalone
dotnet new
Edit project.json to target a version of Microsoft.NETCore.App that is lower than on the box.
Edit project.json to make the project a standalone app.
dotnet restore
dotnet publish
cd /d bin\Debug\netcoreapp1.0\win7-x64
set COREHOST_TRACE=1
standalone.exe 2> log
Expected behavior
The log file contains the version that is targeted by the app not the version that is in the box.
Invoked hostpolicy [commit hash: ebe27982b64300aa6f59e6d304b478b0cd64cc2f] [runtime.win7-x64.Microsoft.NETCore.DotNetHostPolicy,1.0.1-rc2-002565-00,runtimes/win7-x64/native][x64]
Actual behavior
The log file contains version that is on the box and NOT the one the app targeted.
Invoked hostpolicy [commit hash: ebe27982b64300aa6f59e6d304b478b0cd64cc2f] [runtime.win7-x64.Microsoft.NETCore.DotNetHostPolicy,1.0.1-rc2-002565-00,runtimes/win7-x64/native][x64]
Environment data
dotnet --info output:
Commit SHA: 2a49edbb6e
@schellap Both of your posted version strings appear to be the same, is that just a mistake?
Just to illustrate the message, the issue exists.
Alright, I'll take a look
Possibly a duplicate of dotnet/cli#2949 (which is/may be a dupe of dotnet/sdk#5631).
..\win7-x64\publish should contain the correct host binaries.
The build step just copies over the cli's own host binaries.
@dasMulli Publish uses different logic to output the host than build for cross-os scenarios.
So this issue shouldn't be a dupe.
@brthor sry to not mention it: issue mentions bin\Debug\netcoreapp1.0\win7-x64. afaik that is the build output, publish should be in a \pulish subdirectory.
@schellap can you confirm that the issue exists with the output in bin\Debug\netcoreapp1.0\win7-x64\publish\
Very good catch @dasMulli 😄
I have verified that the publish output does not match the one dropped in the folder you have pointed out @schellap (which is the output of dotnet-build)
Closing as a dupe of dotnet/sdk#5631
@brthor just wanted to make sure this will be addressed as part of dotnet/sdk#5631. If not we should keep this open.
The apphost.exe and hostfxr.dll should come from the deps graph into the app base.
Cc @gkhanna79