sdk icon indicating copy to clipboard operation
sdk copied to clipboard

dotnet publish should use host binaries from the project dependency graph

Open schellap opened this issue 10 years ago • 9 comments

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 avatar May 02 '16 21:05 schellap

@schellap Both of your posted version strings appear to be the same, is that just a mistake?

brthor avatar May 11 '16 00:05 brthor

Just to illustrate the message, the issue exists.

schellap avatar May 11 '16 01:05 schellap

Alright, I'll take a look

brthor avatar May 11 '16 01:05 brthor

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 avatar May 11 '16 08:05 dasMulli

@dasMulli Publish uses different logic to output the host than build for cross-os scenarios.

So this issue shouldn't be a dupe.

brthor avatar May 11 '16 17:05 brthor

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

dasMulli avatar May 11 '16 18:05 dasMulli

Very good catch @dasMulli 😄

brthor avatar May 11 '16 18:05 brthor

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 avatar May 27 '16 18:05 brthor

@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

schellap avatar Jul 16 '16 08:07 schellap