9

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.

Prakash
  • 418
  • 1
  • 4
  • 14
  • Can you show us the output of `dotnet --info`? – omajid May 08 '20 at 15:23
  • @OmairMajid part 1 of output .NET Core SDK : Version: 3.1.201 Commit: b1768b4ae7 Runtime Environment: OS Name: Windows OS Version: 10.0.18363 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\3.1.201\ Host (useful for support): Version: 3.1.3 Commit: 4a9f85e9f8 .NET Core SDKs installed: 1.0.0-preview2-003131 [C:\Program Files\dotnet\sdk] 1.1.0 [C:\Program Files\dotnet\sdk] 2.1.513 [C:\Program Files\dotnet\sdk] 3.1.100 [C:\Program Files\dotnet\sdk] 3.1.201 [C:\Program Files\dotnet\sdk] – Prakash May 08 '20 at 15:51
  • Is that the complete output? Can you add it to the question, please? – omajid May 08 '20 at 15:53
  • part 2 of output .NET Core runtimes installed: Microsoft.NETCore.App 1.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] – Prakash May 08 '20 at 15:53
  • part 3 of output Microsoft.NETCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] – Prakash May 08 '20 at 15:54

6 Answers6

10

I solved the problem by installing the Hosting bundle from here.

RobIII
  • 7,384
  • 1
  • 33
  • 79
  • What a simple and highly effective answer. I was moving a Blazor Web Assembly project from my desktop to my laptop and doing the above was one click (clicked on "Hosting bundle" and then it auto downloaded and done. Now my application is working. Thank you! – JsonBytes Nov 03 '20 at 20:09
9

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 .

Prakash
  • 418
  • 1
  • 4
  • 14
  • 2
    Is this a bug? I have exactly the same problem and have to manually copy the files. – Danny May 27 '20 at 23:44
  • This also worked for me, thanks. Out of interest, is anyone else having this problem when they already have SDK v5 installed? I'm wondering if that is one of the causes. – devrobf Feb 11 '21 at 13:01
1

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 
Raphael Silva
  • 51
  • 1
  • 7
0

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

Lasanga Guruge
  • 533
  • 1
  • 3
  • 12
0

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.

ben_mj
  • 322
  • 1
  • 5
  • 13
0

Install the .net core hosting will resolve the issue

tle
  • 1