#8 FDD apps don't find dotnet root
Closed by omajid. Opened by tmds.

DOTNET_ROOT is not set, this causes FDD applications to fail:

Create a FDD Linux application:

$ dotnet new console -o console
$ cd console
$ dotnet publish -c Release --self-contained false -r linux-x64

Executing gives an error:

$ bin/Release/netcoreapp2.2/linux-x64/console
A fatal error occurred, the required library libhostfxr.so could not be found.
If this is a self-contained application, that library should exist in [/tmp/console/bin/Release/netcoreapp2.2/linux-x64/].
If this is a framework-dependent application, install the runtime in the default location [/usr/share/dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location.

This works when DOTNET_ROOT is set:

$ DOTNET_ROOT=/usr/lib64/dotnet bin/Release/netcoreapp2.2/linux-x64/console
Hello World!

@omajid I thought we were setting DOTNET_ROOT, but maybe that was only on RHEL. Can we set this on Fedora too?


I don't see us setting DOTNET_ROOT anywhere :(

Ah, also not on RHEL then?
We can probably do something similar like we are for ~/.dotnet/tools?
Do you want to look at it? Or should I give it a shot?

Please feel free to open a merge request here.

We should add a test to make sure this doesn't happen in the future.

Does this only affect 2.2?

I see that we have a test for this already, but it was targetted for 3.0 explicitly: https://github.com/redhat-developer/dotnet-regular-tests/pull/45

I suppose we should enable this for 2.2 as well? Do we also need to test 2.1?

.NET Core 2.0 has been EOL for ages

Metadata Update from @omajid:
- Issue status updated to: Closed (was: Open)

Metadata