title: Specified framework 'Microsoft.AspNetCore.App', version '3.1.0' was not found for a Linux Azure WebApp
body: <h1>Problem</h1>
  
  <p>After upgrading a .Net Core 2.2 Linux Web App to .Net Core 3.1 in Azure, the application is down with a <code>Specified framework 'Microsoft.AspNetCore.App', version '3.1.0' was not found</code> 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 <code>dotnet --list-runtimes</code> as <code>2.2.7</code>.</p>
  
  <h1>Details</h1>
  
  <p><strong>Website Down</strong></p>
  
  <p><a href="https://i.stack.imgur.com/d3W01.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/d3W01.png" alt="Application Error"></a></p>
  
  <p><strong>Logstream</strong></p>
  
  <p>reporting application is down because it can't find .net core 3.1.</p>
  
  <p><a href="https://i.stack.imgur.com/c6Q1N.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c6Q1N.png" alt="Logstream"></a></p>
  
  <p><strong>Created new .net core web app</strong></p>
  
  <p>3.1 linux webapp in North Central, same problem</p>
  
  <p><a href="https://i.stack.imgur.com/RW7i3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RW7i3.png" alt="Created new web app"></a></p>
  
  <p><strong>Ensured it was running in North Central US</strong></p>
  
  <p>According to <a href="https://aspnetcoreon.azurewebsites.net/" rel="nofollow noreferrer">https://aspnetcoreon.azurewebsites.net/</a>, should have full .netCore 3.1 support</p>
  
  <p><strong>Still .net core 2.2.7</strong>
  <a href="https://i.stack.imgur.com/P2NjX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/P2NjX.png" alt="cmd prompt 2.2.7"></a></p>
  
  <p><strong><code>opt/dotnet/runtimes</code> lists 3, 3.0 and 3.0.0, but no 3.1`</strong>
  <a href="https://i.stack.imgur.com/UQHJ6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UQHJ6.png" alt="enter image description here"></a></p>
  
  <p><strong>Environment variables</strong></p>
  
  <p>My environment variables in Azure list <code>FRAMEWORK_VERSION = lts</code>, instead of 3.1</p>
  
  <p><strong>Publishing</strong></p>
  
  <p>This was published from an azure devops ci pipeline using an Azure AppService Deploy task.  3.1 wasn't available here, so I chose <code>LTS</code></p>
  
  <p><a href="https://i.stack.imgur.com/pe75q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pe75q.png" alt="Devops release pipeline"></a></p>
  
  <h1>Update 1</h1>
  
  <p>It seems the culprit is 3.1 missing from the framework stack in Azure Devops Web App / Web Service tasks.  </p>
  
  <p>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.</p>
  
  <p><strong>New Question</strong></p>
  
  <p>How can I get the Azure Devops Release pipeline to publish a .net core 3.1 task?</p>
  
  <h1>Update 2</h1>
  
  <p><strong>Related Azure Devops forum post</strong> </p>
  
  <p>Currently being investigated as of 2/23/2020</p>
  
  <p><a href="https://developercommunity.visualstudio.com/content/problem/868129/net-core-31-deploy-pipeline-to-linux-app-service.html" rel="nofollow noreferrer">.Net Core 3.1 deploy pipeline to Linux App Service</a></p>
  
  <p><strong>Suggested Workarounds</strong></p>
  
  <ol>
  <li>Use YML for release pipeline and manually change the version from <code>3.0</code> to <code>3.1</code>, noted by answer and <a href="https://developercommunity.visualstudio.com/solutions/855678/view.html" rel="nofollow noreferrer">this thread</a></li>
  <li>Upgrade from a <code>framework dependent</code> release to a <code>self contained</code>. <a href="https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/azure-apps/?view=aspnetcore-3.1&amp;tabs=visual-studio#deploy-aspnet-core-preview-release-to-azure-app-service" rel="nofollow noreferrer">Reference</a></li>
  <li>Downgrade to .NetCore 3.0</li>
  </ol>