sdk: A fatal error was encountered. The library 'libhostpolicy.so' required to execute the application was not found in '/app/bin/Debug/netcoreapp1.0'.

Environment:

  1. VS 15.0.0-RC.2+26027.0.d15prerel
  2. Docker for Windows
  3. Share drive that contains %userprofile%, which is usually c: drive, in the settings of Docker for Windows.

Repro Steps:

  1. Create a new ASP.NET Core Web Application (.NET Core) project.
  2. Uncheck ‘Enable Container (Docker) Support’ if it is checked in the dialog.
  3. Edit .csproj file to add the following in order to workaround https://github.com/dotnet/sdk/issues/557:
  <PropertyGroup>
    <OutputType>exe</OutputType>
  </PropertyGroup>
  1. Reload project.
  2. Right click on the project, Add, Docker Project Support.
  3. F5.

Expected: VS launches the app to run in a Linux container.

Actual: A fatal error was encountered. The library ‘libhostpolicy.so’ required to execute the application was not found in ‘/app/bin/Debug/netcoreapp1.0’. The program ‘’ has exited with code 131 (0x83).

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 15 (5 by maintainers)

Most upvoted comments

The root cause here was a missing reference to Microsoft.NETCore.App package. The SDK needs this reference to emit a correct runtimeconfig. It should be fixed by https://github.com/aspnet/Templates/pull/774

The workaround if that fix hasn’t arrived to you is to add the following to the csproj

    <PackageReference Include="Microsoft.NETCore.App" Version="1.0.1" />

This issue still happening. Even I install explictely the package Microsoft.NETCore.App, the issue still there.