question

RichardGrieveson-0249 avatar image
0 Votes"
RichardGrieveson-0249 asked RichardGrieveson-0249 commented

Blazor Server App Targeting 5.0 changes to 3.1 when published to Azure App Service

Hello

I have a blazor server app that targets 5.0 in Visual Studio. Every time I publish to Azure the Target framework at:

AppService > Configuration > General Settings

changes to 3.1. I then have to change the Azure settings back to 5.0 every time I publish.

Has anyone seen this behavior / have any tips?

Thanks

azure-webapps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Grmacjon-MSFT avatar image
0 Votes"
Grmacjon-MSFT answered RichardGrieveson-0249 commented

Hi @RichardGrieveson-0249

This is odd behavior. What version of Visual Studio are you using? How did you update the target Framework to .NET 5? By default, App Service uses the latest supported .NET Framework version to run your ASP.NET app.


To show current .NET Framework runtime version run this command:

 az webapp config show --resource-group <resource-group-name> --name <app-name> --query netFrameworkVersion


To run your app using .NET Framework 5.0 run the following command:

 az webapp config set --resource-group <resource-group-name> --name <app-name> --net-framework-version v5.0

Best,
-Grace


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hey Grace

I'm using Visual Studio 2019 Preview (16.9.0 Preview 2.0). I just upgraded to 16.10.0 Preview 4.0 and still have the same issue.

So originally the application (In Visual Studio) was targeting 3.1 and at this time the app service would have been targeting 3.1. I then upgraded to 5.0. I think maybe because the app service started of life targeting 3.1 its now confused. Maybe I have to recreate the app service?

As for the command line stuff you shared. I am not familiar with Azure Command Line, but it looks as though that's just doing what I am doing manually through the Azure UI.

Anyway, thanks for your help, but currently I'm still stuck and wondering about recreating the app service...or certainly creating a new one to test.

Thanks

0 Votes 0 ·