The framework 'Microsoft.AspNetCore.App', version '3.1.3' was not found

Viewed 84085

After upgrading targetFramework for my web app from dotnet-core-2.2 to dotnet-core-3.1.2 on another developer machine we are getting following error

It was not possible to find any compatible framework version
The framework 'Microsoft.AspNetCore.App', version '3.1.3' 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=3.1.3&arch=x64&rid=win10-x64

We have tried several approaches to solve the issue

still we are facing the same issue, please guide me to troubleshoot this issue.

10 Answers

I have posted same question on github dotnet issues page, the user vitek karas provided me the lead that x64 runtime C:\ProgramFiles\dotnet\shared\Microsoft.AspNetCore.App\3.1.3 folder was missing.

Then I tried reinstalling SDK 3.1.201 still folder was missing.

I also tried install aspnetcore-runtime-3.1.3 X64 still folder was missing.

finally I have downloaded dotnet-sdk-3.1.201-win-x64.zip and copied Microsoft.AspNetCore.App\3.1.3 folder manually from the zip file to C:\ProgramFiles\dotnet\shared\Microsoft.AspNetCore.App\3.1.3 then my asp.net core application started working .

If you have visual studio installer then open that and click on modify then click individual components and click on .net core 3.1 checkbox and then click modify. Tick the .net Core 3.1(LTS). It will install in the path C:\Program Files\dotnet\shared both Microsoft.AspNetCore.App\3.1.X and Microsoft.NETCore.App\3.1.X that are required

enter image description here

I had a similar issue with dotnet-ef package. I was developing using .NET 5 and the already installed dotnet-ef package was at 3.1.0 version.

Solution:

  • Uninstall deprecated package globally (I am on Linux so I use dotnet CLI)
dotnet tool uninstall dotnet-ef -g
  • Reinstall up-tp-date package version:
dotnet tool install --global dotnet-ef --version 5.0.1 

Installing the .net core 3.1 runtime via visual studio setup worked for me:

enter image description here

Execute dotnet --version in cmd and check whether the correct version (3.1.201) is installed. It is referring to the .NET Core Runtime version, not the sdk version. Your application now having the latest versions.

sdk 3.1.201 - runtime 3.1.3

I am targeting 3.1.101 and had this same error.

I resolved this issue by un-installing 3.1.2 shared framework (installed by someone else unbeknown to me)

The takeaway is, try to only have the version you require otherwise .NET seems to get confused.

Install the .net core hosting will resolve the issue

Having similar situation I did:

  1. update docker
  2. update vs
  3. install latest SDK

Then it started to work and resolved few more issues related to or caused by docker tooling

Related