Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found

I have deployed my app on a production machine. I am publishing Release, win-x64 and --self-contained true. I have installed .net core 3.1.7 restarted the VPS and I am getting:

The specified version of Microsoft.NetCore.App or Microsoft.AspNetCore.App was not found.

dotnet --info returns:

  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download

Host (useful for support):
  Version: 3.1.7
  Commit:  fcfdef8d6b

.NET Core SDKs installed:
  No SDKs were found.

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

my .csproj file is the following

<PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
<PropertyGroup>

Anyone knows why am I getting this error?

like image 688
pantonis Avatar asked Aug 18 '20 05:08

pantonis


2 Answers

From my end, I was facing this issue when trying to start IIS server on my local machine. I downloaded .NET Core 3.1 SDK and the problem is now solved.

like image 195
Ram Fattah Avatar answered Oct 12 '22 15:10

Ram Fattah


Try to add this in your .csproj file:

<PropertyGroup>
  <RollForward>Major</RollForward>
</PropertyGroup>
like image 1
Kasun Madusanka Avatar answered Oct 12 '22 15:10

Kasun Madusanka