Home > OS >  An error occurred while loading required library hostpolicy.dll
An error occurred while loading required library hostpolicy.dll

Time:05-10

This error comes up when trying to perform initial add-migration on a sql database in Visual Studio 2022. However when I check the Dll path it is there. My computer is a Macbook and I do Windows virtualization to run VS 2022 and the operating system is Arm 64 bit.

Failed to load the dll from [C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.16\hostpolicy.dll], HRESULT: 0x800700C1 An error occurred while loading required library hostpolicy.dll from [C:\Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.16]

How can I solve this?

CodePudding user response:

This appears to be duplicate of "The library hostpolicy.dll was not found".

Based on a more recent answer...this issue may have been resolved in 5.0.2. You could consider updating your SDK version.

CodePudding user response:

Install the X86 version of the .net core runtime framework, in the 5.0.16 folder in the corresponding folder under the C:\Program Files\dotnet\shared\ path, download the binary file on the official website and unzip the corresponding path file in C:\ After running under Program Files\dotnet\shared\

  • Related