janitheshan
janitheshan

Reputation: 325

.NET Core application publish fail

My .NET Core 3.1 application stopped publishing suddenly and display the below error,

It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '1.0.0' was not found.
- The following frameworks were found:
  2.1.15 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  2.2.8 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  3.1.1 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

Below is the dotnet --info output

Version:   3.1.101

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.101\

Host (useful for support):
Version: 3.1.1

.NET Core SDKs installed:
2.2.207 [C:\Program Files\dotnet\sdk]
3.1.101 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.15 [C:\Program 
Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.8 [\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.15 [\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.8 [\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.1 [\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.15 [\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.8 [\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.1 [\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.1 [\Microsoft.WindowsDesktop.App]

Any idea why this is happening?

Upvotes: 0

Views: 521

Answers (2)

janitheshan
janitheshan

Reputation: 325

Found the issue. In my case, it was the dotnet bundle PrePublishScript command.

<Exec Command="dotnet bundle" />

removing above from my .csproj worked. Not sure why it happened suddenly without even changing the .csproj file.

Upvotes: 1

omajid
omajid

Reputation: 15223

Your application is targeting .NET Core 1.0, but it's not installed.

You have 2.1, 2.2 and 3.1 installed, but not 1.0, that your application needs.

You need to install .NET Core 1.0.

1.0 has been out of support for years and is missing critical fixes. You should think about upgrading this application to a supported .NET or .NET Core release.

Upvotes: 0

Related Questions