After deploying a .NET 5 application in an Azure App Service, I got the following error message when I tried to run the application:
HTTP Error 500.31 - ANCM Failed to Find Native Dependencies
Common solutions to this issue:
The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found.
This is because in Azure App Service .NET 5 is not enabled by default (yet).
Let’s see how to fix this:
- Open the Azure portal
- Go to the App Service you want to configure
- Click on Configuration in the Settings section
- Go to the Stack Settings and change the .NET Framework version to .NET 5(Early Access)
- Click Save
- Restart the App Service