[ARM32]With .NET 5 SDK installed, running application failed with error required library libhostfxr.so could not be found.
See original GitHub issueRepro steps:
- Prepare Ubuntu20.04 container on ARM32.
- Install .NET 5 SDK with ARM Binaries(tar -xf dotnet-sdk-5.0.403-linux-arm.tar.gz, installation path: “/root/mytest”).
- Create a new console app and try to run it.
Expected Result: App could be run successfully.
Actual Result: Running app failed with error required library libhostfxr.so could not be found.
root@4eb6957f9afc:~/myconsole# dotnet run
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 [/root/myconsole/bin/Debug/net5.0/].
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].
The .NET runtime can be found at:
- https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=arm&rid=ubuntu.20.04-arm&apphost_version=5.0.12
Note:
- After manually set
DOTNET_ROOT
, it can be run successfully. - It was not repro on ARM64
Dotnet info:
root@4eb6957f9afc:~/mytest# dotnet --info
.NET SDK (reflecting any global.json):
Version: 5.0.403
Commit: cd8226c2c5
Runtime Environment:
OS Name: ubuntu
OS Version: 20.04
OS Platform: Linux
RID: ubuntu.20.04-arm
Base Path: /root/mytest/sdk/5.0.403/
Host (useful for support):
Version: 5.0.12
Commit: 88faabc950
.NET SDKs installed:
5.0.403 [/root/mytest/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.12 [/root/mytest/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.12 [/root/mytest/shared/Microsoft.NETCore.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
.net - The required library libhostfxr.so could not be found. ...
Solved by adding this in whatever part of shell profile (it can be at the end): # Netcore export PATH=$PATH:$HOME/.dotnet/tools export ...
Read more >Troubleshoot .NET package mix ups on Linux
These errors may occur when you run the dotnet command. ... A fatal error occurred. The required library libhostfxr.so could not be found....
Read more >Dotnet-script, libhostfxr.so not found
When I run dotnet-script, I get this error: dotnet-script A fatal error occurred. The required library libhostfxr.so could not be found.
Read more >Library error while Installing .Net Core
NET Core. Run that script. 2) Run sudo apt-get install dotnet-dev-1.0.0-preview2-003118 . – edwinksl.
Read more >The state of .NET Core on Arch : r/archlinux
NET Core runtime: $ de4dot --help A fatal error occurred, the required library libhostfxr.so could not be found.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ericstj I think we raced to answer this one - I’m pretty sure it’s the bug in
dotnet run
as mentioned above.To verify the theory, set DOTNET_ROOT so that the app starts, and print out
Environment.GetEnvironmentVariable("DOTNET_ROOT(x86)")
- this should never be set on Linux, but I would bet it’s set this time.Correct - this should affect all arm32 private installs for 3.1/5.0.