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.

Self-contained linux app missing libhostfxr.so

See original GitHub issue

Using 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
timmydocommented, Jan 17, 2019

Using that other build seemed to fix it. Thanks.

1reaction
peterhuenecommented, Jan 17, 2019

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

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

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