0

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?

1 Answers1

0

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.

CER
  • 224
  • 1
  • 3
  • I installed .NET 5.0.2 as you said but Visual Studio continues to recognize the previous version and displays the same message. – Vitor Oliveira May 09 '22 at 20:03
  • This link might help https://support.microsoft.com/en-us/help/2533623/microsoft-security-advisory-insecure-library-loading-could-allow-remot – Housheng-MSFT May 12 '22 at 02:17