Self-contained linux app missing libhostfxr.so
See original GitHub issueUsing https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-linux-x64.tar.gz
RUN dotnet restore --runtime linux-x64 --configfile /app/Nuget.Config RUN dotnet publish -c Release -f netcoreapp3.0 --self-contained --runtime linux-x64 --no-restore -o /out
csproj is roughly
<PropertyGroup>
<TargetFrameworks>netcoreapp3.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RuntimeIdentifiers>win10-x64;linux-x64</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
# ./Watchdogs
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 [/app/Watchdogs/].
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.
# ldd ./Watchdogs
linux-vdso.so.1 (0x00007fff783f2000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff3e590a000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff3e56ed000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007ff3e536b000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff3e5067000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ff3e4e50000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff3e4ab1000)
/lib64/ld-linux-x86-64.so.2 (0x00007ff3e5b0e000)
I think this is a recent development. The previous sdk nightly worked fine. There are no *.so files in the output directory
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:10 (4 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
Learn about how to troubleshoot strange .NET package errors on Linux. These errors may occur when you run the dotnet command.
Read more >dotnet Core 3 runtime snap not found in Ubuntu Core
I have a .Net Core 3 console app published for linux-x64. I want to run it on Ubuntu Core 18. I have installed...
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 >The state of .NET Core on Arch : r/archlinux
Hello,. I'd like to discuss some issues related to working with .NET Core (and Mono) on Arch Linux. Many times in the past...
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 Free
Top 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
Using that other build seemed to fix it. Thanks.
@nguerrera since it sounds like you have a working theory, feel free to assign to you as I simply self-assigned so I could poke it with a stick tomorrow.