We have recently upgrade a .NET Core 2.2 application to 3.1 version. While trying to run it in Visual Studio, we came across “rzc discover exited” and “hostpolicy.dll required” errors:
- In Visual Studio output while trying to run the solution:
rzc discover exited with code -2147450749
- In PowerShell after performing “build run” command:
A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in [path]
Solution for “rzc discover exited with code -2147450749” and “hostpolicy.dll required” errors
The solution was simple: Reinstalling (or repairing) .NET Core! You may need to repair Visual Studio as well.
After fixing these issues, you may see another error, “HTTP Error 500.30”. Here is the root cause and solution for this error: HTTP Error 500.30 – ANCM In-Process Start Failure