16

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?

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
pantonis
  • 5,601
  • 12
  • 58
  • 115
  • Could you please tell me how you host your application? On IIS or server directly? – Brando Zhang Aug 18 '20 at 07:55
  • 2
    You need a hosting bundle, if IIS is used – Pavel Anikhouski Aug 18 '20 at 08:08
  • 3
    I answered a similar question today, please follow this check-list: https://stackoverflow.com/a/63466234/14072498 – Roar S. Aug 18 '20 at 11:22
  • 1
    I found the issue. I deleted this file SOS_README.md and when I enabled stdlog I got the error that SOS_README.md is missing. Misleading error message. – pantonis Aug 18 '20 at 12:36
  • 3
    If you are publishing as self-contained then you don't need .NET Core installed on the host machine – jspinella Dec 16 '20 at 15:36
  • In my case (.NET 5 Web App), I had this excerpt in web.config: ``. The error was, that "MyWeb.dll" did not exist (I renamed it recently). So I adjusted the `arguments` to point to the correct DLL and then, that error went away. – Uwe Keim Jan 11 '21 at 14:12

2 Answers2

2

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.

Ram Fattah
  • 349
  • 2
  • 11
1

Try to add this in your .csproj file:

<PropertyGroup>
  <RollForward>Major</RollForward>
</PropertyGroup>
Jackdaw
  • 7,626
  • 5
  • 15
  • 33
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 19 '21 at 15:18