3

I have a .Net Core 3 console app published for linux-x64.
I want to run it on Ubuntu Core 18.
I have installed the dotnet-runtime-30 Snap and aliased it like on this question.

When run the binary normally I get:

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 [/home/anthony-c/linux-x64/].
If this is a framework-dependent application, install the runtime in the global location [/usr/share/dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location or register the runtime location in [/etc/dotnet/install_location].

When I run the program's dll with dotnet scan.dll I get:

Invalid runtimeconfig.json [/home/anthony-c-ct4/linux-x64/Canopy.ScanPorts.runtimeconfig.json] [/home/anthony-c-ct4/linux-x64/Canopy.ScanPorts.runtimeconfig.dev.json]

Search for that error returns this question but I have write access to the folder.

The dotnet runtime seems valid enough to me:

anthony-c@localhost:~/linux-x64$ dotnet --info
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download

Host (useful for support):
  Version: 3.0.0
  Commit:  95a0a61858

.NET Core SDKs installed:
  No SDKs were found.

.NET Core runtimes installed:
  Microsoft.NETCore.App 3.0.0 [/snap/dotnet-runtime-30/1/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

When I use classic Ubuntu with .Net Core runtime installed via the standard debs it works both both with the binary and calling the dll.

When I publish the app Self-Contained instead of Framework Dependant the app runs as expected. However I would rather use Framework Dependant as the app will be calling plugins.

Is there a different way I should be running .Net Core apps on Ubuntu Core or something else I'm missing? (Thanks)

0 Answers0