After upgrading a project from ASP.NET Core 3.0 to ASP.NET Core 3.1, my application stopped working on Azure App Services—but only when published using continuous deployment from Azure DevOps Pipelines. (Similar to another question, it continues to work if I publish directly from Visual Studio.)
Specifically, the pipeline is still able to publish using the Azure App Service Deploy (AzureRmWebAppDeployment
) task, but it fails to load in the Azure App Service environment with a 500.32 exception:
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.
Now, I'm quite familiar with this error for cases where the .NET Runtime is not installed, as is common immediately after Microsoft releases new versions. In those cases, the typical solution is to either:
- Publish as a
--self-contained
version of the application, or to - Enable the appropriate runtime as an App Service Extension, if available.
In this case, I know the .NET Core 3.1.2 runtime is available in the App Services environment, and have additionally confirmed that these solutions don't resolve the issue. This indicates a different underlying error.
Other threads suggest looking for those details in the Windows Event Viewer (and here as well). Since this is an Azure App Service, I instead looked in the App Service Logs. Those only included a copy of the above error, however, without any further details. Further, there are no exceptions logged in Azure Application Insights, suggesting this error is occurring prior to Application Insights loading.
Given this, my question: How do I troubleshoot 500.31 errors on an Azure App Service?