#24 profile.d/dotnet.sh: set DOTNET_ROOT to shared framework location
Closed 4 years ago by tmds. Opened 5 years ago by tmds.
dotnet-sig/ tmds/dotnet-2-1 dotnet_root  into  master

file modified
+3
@@ -1,4 +1,7 @@ 

  

+ # Set location of shared framework

+ [ -z "$DOTNET_ROOT" ] && DOTNET_ROOT=/usr/lib64/dotnet

+ 

  # Add dotnet tools directory to PATH

  DOTNET_TOOLS_PATH="$HOME/.dotnet/tools"

  case "$PATH" in

Thanks. This is probably a stupid question, but what issues does it solve given that the apphost feature is not present in 2.1?

The publish doesn't include a native host by default, like it will with 3.0.

You can still get one if you specified the rid (e.g. -r linux-x64) and set --self-contained false on the publish command.

I can't observe the behaviour on 2.1:

$ mkdir Project
$ cd Project/
$ dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   2.1.506
 Commit:    c53a7afafc

Runtime Environment:
 OS Name:     fedora
 OS Version:  29
 OS Platform: Linux
 RID:         fedora.29-x64
 Base Path:   /usr/lib64/dotnet/sdk/2.1.506/

Host (useful for support):
  Version: 2.1.10
  Commit:  9013a2af4b

.NET Core SDKs installed:
  2.1.506 [/usr/lib64/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.NETCore.App 2.1.10 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download
$ dotnet new console
The template "Console Application" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on /home/omajid/temp/Project/Project.csproj...
  Restoring packages for /home/omajid/temp/Project/Project.csproj...
  Generating MSBuild file /home/omajid/temp/Project/obj/Project.csproj.nuget.g.props.
  Generating MSBuild file /home/omajid/temp/Project/obj/Project.csproj.nuget.g.targets.
  Restore completed in 200.64 ms for /home/omajid/temp/Project/Project.csproj.

Restore succeeded.

$ dotnet publish -r linux-x64 --self-contained false
Microsoft (R) Build Engine version 15.9.20.62826 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restoring packages for /home/omajid/temp/Project/Project.csproj...
  Restore completed in 205.7 ms for /home/omajid/temp/Project/Project.csproj.
  Project -> /home/omajid/temp/Project/bin/Debug/netcoreapp2.1/linux-x64/Project.dll
  Project -> /home/omajid/temp/Project/bin/Debug/netcoreapp2.1/linux-x64/publish/
[omajid@trull Project]$ find
.
./Project.csproj
./Program.cs
./obj
./obj/Project.csproj.nuget.g.targets
./obj/Project.csproj.nuget.g.props
./obj/project.assets.json
./obj/Project.csproj.nuget.cache
./obj/Debug
./obj/Debug/netcoreapp2.1
./obj/Debug/netcoreapp2.1/linux-x64
./obj/Debug/netcoreapp2.1/linux-x64/Project.pdb
./obj/Debug/netcoreapp2.1/linux-x64/Project.csprojAssemblyReference.cache
./obj/Debug/netcoreapp2.1/linux-x64/Project.AssemblyInfo.cs
./obj/Debug/netcoreapp2.1/linux-x64/Project.assets.cache
./obj/Debug/netcoreapp2.1/linux-x64/Project.dll
./obj/Debug/netcoreapp2.1/linux-x64/Project.csproj.FileListAbsolute.txt
./obj/Debug/netcoreapp2.1/linux-x64/Project.csproj.CoreCompileInputs.cache
./obj/Debug/netcoreapp2.1/linux-x64/Project.AssemblyInfoInputs.cache
./bin
./bin/Debug
./bin/Debug/netcoreapp2.1
./bin/Debug/netcoreapp2.1/linux-x64
./bin/Debug/netcoreapp2.1/linux-x64/Project.pdb
./bin/Debug/netcoreapp2.1/linux-x64/Project.runtimeconfig.json
./bin/Debug/netcoreapp2.1/linux-x64/publish
./bin/Debug/netcoreapp2.1/linux-x64/publish/Project.pdb
./bin/Debug/netcoreapp2.1/linux-x64/publish/Project.runtimeconfig.json
./bin/Debug/netcoreapp2.1/linux-x64/publish/Project.dll
./bin/Debug/netcoreapp2.1/linux-x64/publish/Project.deps.json
./bin/Debug/netcoreapp2.1/linux-x64/Project.dll
./bin/Debug/netcoreapp2.1/linux-x64/Project.runtimeconfig.dev.json
./bin/Debug/netcoreapp2.1/linux-x64/Project.deps.json
$ find -iname Project

I'm not sure if there is an outstanding question in this or not o.o

Given that:

  • .NET Core 2.1 doesn't build an apphost executable that demonstrates the bug

  • Anyone using dotnet-sig copr repo actually gets the dotnet-host package version 2.2.x (which already includes this fix) even for .NET Core 2.1

I am not inclined to merge this PR. Please change my mind!

My mistake, indeed 2.1 doesn't support the FDD apphost at all.

Pull-Request has been closed by tmds

4 years ago
Metadata