How to fix - You must install or update .NET to run this application

Bashar Muhanna 35 Reputation points
2023-06-13T08:40:17.94+00:00
root@ubuntu:/etc/systemd/system# /usr/bin/dotnet /var/www/MinAPI/WebApi.dll
You must install or update .NET to run this application.

App: /var/www/MinAPI/WebApi.dll
Architecture: x64
Framework: 'Microsoft.AspNetCore.App', version '5.0.0' (x64)
.NET location: /usr/lib/dotnet/

The following frameworks were found:
  7.0.5 at [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]

Learn about framework resolution:
https://aka.ms/dotnet/app-launch-failed

To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.AspNetCore.App&framework_version=5.0.0&arch=x64&rid=ubuntu.23.04-x64
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,924 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,618 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 66,866 Reputation points
    2023-06-13T15:43:50.11+00:00

    you need to install the obsolete .net 5.0 runtime:

    https://dotnet.microsoft.com/en-us/download/dotnet/5.0

    or get a .net 7 build of the app.

    1 person found this answer helpful.

  2. Amit Choudhary 0 Reputation points
    2023-06-17T11:48:45.4466667+00:00

    how to install the .NET package on Azure bash?


  3. Byron Jones 0 Reputation points
    2023-11-01T19:49:17.87+00:00

    If you are seeing this error in your Azure DevOps CI pipeline, you need to add the following task to your Yaml file, just before the build step:

    - task: UseDotNet@2
      displayName: 'Use .NET 5 sdk'
      inputs:
        packageType: sdk
        version: '5.0.x'
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.