11
votes

Problem

After upgrading a .Net Core 2.2 Linux Web App to .Net Core 3.1 in Azure, the application is down with a Specified framework 'Microsoft.AspNetCore.App', version '3.1.0' was not found error. I even went as far to create a new Linux Web App with .Net Core 3.1, and after the bash command prompt is still outputting dotnet --list-runtimes as 2.2.7.

Details

Website Down

Application Error

Logstream

reporting application is down because it can't find .net core 3.1.

Logstream

Created new .net core web app

3.1 linux webapp in North Central, same problem

Created new web app

Ensured it was running in North Central US

According to https://aspnetcoreon.azurewebsites.net/, should have full .netCore 3.1 support

Still .net core 2.2.7 cmd prompt 2.2.7

opt/dotnet/runtimes lists 3, 3.0 and 3.0.0, but no 3.1` enter image description here

Environment variables

My environment variables in Azure list FRAMEWORK_VERSION = lts, instead of 3.1

Publishing

This was published from an azure devops ci pipeline using an Azure AppService Deploy task. 3.1 wasn't available here, so I chose LTS

Devops release pipeline

Update 1

It seems the culprit is 3.1 missing from the framework stack in Azure Devops Web App / Web Service tasks.

Whenever I publish from CI, the web app framework is updated to whatever is selected in this dropdown. If I manually go change the framework to 3.1 on the Azure Web App, the site comes up. But then the next publish it goes back down because it reverts the framework back to the settings in the ci.

New Question

How can I get the Azure Devops Release pipeline to publish a .net core 3.1 task?

Update 2

Related Azure Devops forum post

Currently being investigated as of 2/23/2020

.Net Core 3.1 deploy pipeline to Linux App Service

Suggested Workarounds

  1. Use YML for release pipeline and manually change the version from 3.0 to 3.1, noted by answer and this thread
  2. Upgrade from a framework dependent release to a self contained. Reference
  3. Downgrade to .NetCore 3.0
2
Instead of using LTS please try using latest (its not recommended but try it anyway, will see whether its working or not)Manish
I did, and it didn't work. But CI seems to be the problem. Every time I publish with CI it changes the framework on the web app to whatever is selected in CI. If I go to the app service after a CI publish and manually change the runtime stack to 3.1, the site comes up until the next publish.w00ngy
DO NOT post images of code, data, error messages, etc. - copy or type the text into the question. How to AskRob

2 Answers

3
votes

I've run into the same situation, using the information you provided I've been able to fix the issue by setting the value manually in the Devops Pipelines Build .yml file. It seems like they are just missing the value from RunTime Stack drop down. If you manually update the build processes .yml file as seen here:

enter image description here

This will select the proper framework version. Hopefully this will fix your issue with the Azure Devops CI Pipeline deployment.

1
votes

An easier solution is to type DOTNETCORE|3.1 into the Runtime Stack dropdown in devops. (Thanks rdavisau!)

enter image description here