Sdk: .NET Core 1.1 SDK and Runtimes fails to run until compiled twice : Mising hostpolicy.dll

Created on 17 Jan 2017  路  6Comments  路  Source: dotnet/sdk

I have been using VS2017RC with .Net core pretty successfully until upgrading to SDK and runtimes 1.1. Once I upgraded to 1.1, I now have to compile the solution 2 times to get it to run. The error on the first attempt at running is always: A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\Path to project bin\bin\Debug\netcoreapp1.1'. After a 2nd compile, it always works. The error is not very helpful and as you can see here: #1894- Others are having the same issue. In #1894, steps to reproduce are listed. I did switch to the nightly builds for a couple of hours to see if this has been addressed and the same issue still exists.

Bug Urgency-Soon release blocking

Most helpful comment

I am facing this issue with Visual Studio 2017, Preview 3. Any fixes, why is it becoming so big a task to understand the error messages and resolve in the newer versions of .Net.

All 6 comments

If anyone figures out a workaround, I would appreciate it. This has well over doubled my time to change anything in the application. Thank you.

Do you happen to know what this issue is and If there is any kind of workaround I can try on my end. This has completely stalled my development now. Thanks in advance.

I think this is fixed. I tried reproing it, and with an older version of the .NET CLI (1.0.0-preview5-004232) that I had installed, it always failed to run with the hostpolicy.dll error. However, when I tried it with the version of the CLI we're using in the .NET SDK (1.0.0-preview5-004456), dotnet run always succeeded for me. In aspnet/Home#1894, @IsaackRasmussen also reported that a later version of the CLI (1.0.0-rc4-004578) fixed the issue.

Closing this out. Please reopen if you are seeing with the latest CLI.

Updating to 1.1.1 with the security fix and updating to the latest 2017RC solved this problem for me.

I am facing this issue with Visual Studio 2017, Preview 3. Any fixes, why is it becoming so big a task to understand the error messages and resolve in the newer versions of .Net.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

darrensimio picture darrensimio  路  3Comments

srivatsn picture srivatsn  路  3Comments

gkhanna79 picture gkhanna79  路  3Comments

davkean picture davkean  路  3Comments

thomaslevesque picture thomaslevesque  路  3Comments