A fatal error was encountered. The library 'libhostpolicy.so' required A fatal error was encountered. The library 'libhostpolicy.so' required docker docker

A fatal error was encountered. The library 'libhostpolicy.so' required


For me it was the following line that I had to add to the project file's PropertyGroup section that did the trick:

<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>

Project file excerpt


After some googleing I found this:
https://github.com/aspnet/aspnet-docker/issues/301

I'm not certain what caused it but it seems to have gone away. It's probably because I had a case mismatch of appSettings.json instead of appsettings.json which meant that the file was not being loaded. Terrible error though.

In my case it was that I had forgot to put appsettings.json to copy on builds.

enter image description here

Hope this helps someone else and get's higher on google searches.


After even more googling, we found this link:

http://szahariev.blogspot.co.nz/2016/10/libhostpolicyso-was-not-found-error.html

which lead us to discover that we'd somehow managed to manually remove the (in our case) <OutputType>Exe</OutputType> line from our .csproj file. So no runtimeconfig.json was created at all.