question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[ARM32]With .NET 5 SDK installed, running application failed with error required library libhostfxr.so could not be found.

See original GitHub issue

Repro steps:

  1. Prepare Ubuntu20.04 container on ARM32.
  2. Install .NET 5 SDK with ARM Binaries(tar -xf dotnet-sdk-5.0.403-linux-arm.tar.gz, installation path: “/root/mytest”).
  3. 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:

  1. After manually set DOTNET_ROOT, it can be run successfully.
  2. 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:open
  • Created 2 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
vitek-karascommented, Oct 25, 2021

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

0reactions
vitek-karascommented, Oct 31, 2021

Correct - this should affect all arm32 private installs for 3.1/5.0.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found