skip to Main Content

I made serval changes in our api, one of them was upgrading to .net7. After deploying I get this error when the Azure Web App starts. Does anyone know how I can fix this?

Could not find ‘aspnetcorev2_inprocess.dll’. Exception message: You
must install or update .NET to run this application.

Framework: 'Microsoft.NETCore.App', version '7.0.10' (x86)
.NET location: C:Program Files (x86)dotnet

I did select .NET 7 (STS)
enter image description here

If I downgrade to .net6 I got exactly the same error, except it can’t find ‘6.0.21’ (6.0.19 is installed) instead of ‘7.0.10’

The following frameworks were found:
  .......
  6.0.19 at [C:Program Files (x86)dotnetsharedMicrosoft.NETCore.App]
  7.0.5 at [C:Program Files (x86)dotnetsharedMicrosoft.NETCore.App]
  7.0.8 at [C:Program Files (x86)dotnetsharedMicrosoft.NETCore.App]

EDIT:
I ‘solved’ it by adding this step in my pipeline:

- task: UseDotNet@2
  inputs:
    packageType: 'sdk'
    version: '7.0.305'

7.0.8 matches SDK 7.0.305 see: https://dotnet.microsoft.com/en-us/download/dotnet/7.0

2

Answers


  1. I faced the same error error recently and reason why was because even though my dotnet frameworks were installed on the machine, I was missing the dotnet runtimes for 7.0.

    Installing the dotnet core runtime fixed it for me.

    You can run the following command to see what runtimes are currently available on the machine running your web app :
    dotnet --list-runtimes

    you can download the dotnet core 7.0 runtime from here : https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-aspnetcore-7.0.10-windows-x64-installer

    The above link is for windows x64, but if you have a different OS download the relevant runtime based on your OS or arch here : https://dotnet.microsoft.com/en-us/download/dotnet/7.0

    Login or Signup to reply.
  2. Looks like I misunderstood your question earlier.

    From what I understand, you have a running web app in azure portal and you have upgraded the app you deploy to it.

    Just make sure the stack you have in your web apps -> configuration -> general settings tab is set to to the exact dotnet version you require.

    Ex for dotnet 7.0 you need to set the following and save (which should restart your app) and then do a redeployment :

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search