"Could not load host policy library" after updates
See original GitHub issueWhen I try to run an application that includes the Microsoft.NETCore.App
library, such as the one created by dotnet new
, I get the error message…
“Could not load host policy library”
Steps to reproduce
- Install the latest
dot net cli
build (as of 3/24/2016 - 4:11 PM CST, it is version1.0.0-beta-001986
) - create a new folder anywhere
- open a command line in the new folder
- in the command line, run
dotnet new
- in the
project.json
, changeMicrosoft.NET.Core.App
to use version1.0.0-rc-*
- in the command line, run
dotnet restore
- in the command line, run
dotnet run
Expected behavior
The app should run as expected; Hello World!
ought to be printed to the console.
Actual behavior
The following is printed to the console.
NuGet Config files used:
C:\Users\Ciel\Documents\Visual Studio 2015\Projects\n\NuGet.Config
C:\Users\Ciel\AppData\Roaming\NuGet\NuGet.Config
Feeds used:
https://dotnet.myget.org/F/dotnet-core/api/v3/index.json
https://api.nuget.org/v3/index.json
PS C:\Users\Ciel\Documents\Visual Studio 2015\Projects\n> dotnet run
Compiling n for .NETStandard,Version=v1.5
C:\Users\Ciel\Documents\Visual Studio 2015\Projects\n\project.json(7,30): warning NU1007: Dependency specified was Microsoft.NETCore.App >= 1.0.0-rc-* but ended up with Microsoft.NETCore.App 1.0.0-rc2-23910.
Compilation succeeded.
1 Warning(s)
0 Error(s)
Time elapsed 00:00:02.2376827
Could not load host policy library [C:\Users\Ciel\Documents\Visual Studio 2015\Projects\n\bin\Debug\netstandard1.5]
Environment data
dotnet --version
output:
.NET Command Line Tools (1.0.0-beta-001986)
Product Information:
Version: 1.0.0-beta-001986
Commit Sha: f0fd9ae901
Runtime Environment:
OS Name: Windows
OS Version: 10.0.10586
OS Platform: Windows
Runtime Id: win10-x64
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:15 (4 by maintainers)
Top Results From Across the Web
The library hostpolicy.dll was not found
NET Core project (console app) that I'm trying to compile and run. dotnet build succeeds, but I get the following error when I...
Read more >Improving .NET host error messages and supportability
NET app is launched by a native host, which needs to find and load a compatible .NET runtime to execute app code. Sometimes...
Read more >Error: Unable to load shared library 'hostfxr' or one of its ...
Hi, I am running on macOS Big Sur version 11.7.1 on Intel Processor. After I installed Radzen Blazor Studio, I tried to create...
Read more >How to Fix the 'Preview Could Not Be Loaded' Error
If you receive the error message “the preview could not be loaded”, try the following: Enable Safe Mode. Follow the procedures outlined in...
Read more >Troubleshoot WorkSpaces issues - AWS Documentation
I am trying to do something that requires Windows installation media but WorkSpaces does not provide it. I want to launch WorkSpaces with...
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 FreeTop 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
Top GitHub Comments
@ciel BTW… I attemped to run the HelloMvc sample app from https://github.com/aspnet/cli-samples on my Windows 10 setup with the latest CLI and ran into the same issue I logged here: https://github.com/aspnet/Mvc/issues/4349 so although neither works at lease both my Mac and Windows machine are on par 😕
FYI, in order to get the HelloMvc app to run against the latest CLI I updated the
project.json
to this:NOTE: I used
netcoreapp1.0
instead ofnetstandardapp1.5
based on this thread: https://github.com/NuGet/Home/issues/2299@nil4 thanks. It confusing to have nuget.exe and dotnet.exe at the same time. dotnet CLI should be able to do any work nuget.exe can do.