Resolving 500.31 ANCM on Azure App Service when Deploying form Visual Studio Code
When a new version of .NET Core is released, Azure may still be behind receiving the framework version. At any point, you can see what is installed within your Azure App Service by entering the Console within the Development Tools menu on the Azure App Service resource and typing dotnet --info
:
Even the .NET Core 5.0 Preview 4 is now released, it is still not a valid target framework for Azure. So, if you are using .NET Core 5 and run dotnet new
to create a new project, you may find that you need to make a few subtle changes.
- You will need to update the
.csproj
so the target framework is set to 3.1 (or a valid installed Azure framework) such as<TargetFramework>netcoreapp3.1</TargetFramework>
- You will need to deploy your application as a self-contained app.
Depending on the approach, you may still notice that the app is not functioning correctly. This may be because of the .vscode
folder that is created in the app. Visual Studio Code creates this folder so that it can store project level settings, tasks, and launch settings. If you pay attention to the settings.json
file, you may see a setting called appService.deploySubpath
. This setting will be set if you are using Azure App Services. If so, check that it is set to the correct temporary path.