The framework 'Microsoft.AspNetCore.App', version '5.0.0' was not found. when it is installed and inside $PATH
Asked Answered
I

1

36

I am working in Manjaro Linux.

I have a .NET Core project. The solution builds fine when I run dotnet build .

However, when I run:

dotnet-ef update --project Bejebeje.DataAccess --startup-project Bejebeje.Mvc

I get the following strange error:

Build started...
Build succeeded.
It was not possible to find any compatible framework version
The framework 'Microsoft.AspNetCore.App', version '5.0.0' was not found.
  - No frameworks were found.

You can resolve the problem by installing the specified framework and/or SDK.

The specified framework can be found at:
 - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.AspNetCore.App&framework_version=5.0.0&arch=x64&rid=manjaro-x64

It is strange because I already have the SDKs and runtimes for .NET 5.0 installed.

bejebeje|feature/upgrade-to-net-5 ⇒ dotnet --list-sdks
3.1.108 [/usr/share/dotnet/sdk]
5.0.103 [/usr/share/dotnet/sdk]
bejebeje|feature/upgrade-to-net-5 ⇒ dotnet --list-runtimes
Microsoft.NETCore.App 3.1.8 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.3 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
bejebeje|feature/upgrade-to-net-5 ⇒

Why is this happening? and what can I do to solve the problem?

Ingeringersoll answered 21/2, 2021 at 10:48 Comment(1)
github.com/dotnet/sdk/issues/16427Obtrusive
I
62

I had the same problem. You need to have an ASP.NET runtime.

It's a bit confusing and easily overlooked, but it says you need an Microsoft.AspNetCore.App runtime, and your dotnet --list-runtimes only lists Microsoft.NETCore.Apps.

The ArchWiki mentions:

This is caused because the runtime is shipped as a separate package in Arch. You just need to make sure you have the aspnet-runtime package installed as well.

To install the .NET 5 runtime:

sudo pacman -Sy aspnet-runtime

or if you need the 3.1 version:

sudo pacman -Sy aspnet-runtime-3.1

Now there's an ASP runtime available:

$ dotnet --list-runtimes
Microsoft.AspNetCore.App 5.0.4 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]  # <<<
Microsoft.NETCore.App 5.0.4 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Indisposition answered 11/3, 2021 at 8:18 Comment(3)
You are my hero!Lorrianelorrie
Thank you sir!!Photogram
I'm so angry that I overlooked this, thank you so much for ending my suffering!Sort

© 2022 - 2024 — McMap. All rights reserved.