Is it possible to run netcore 3.x application under the net5

Mia Wu-MSFT 327 Reputation points Microsoft Employee
2021-01-29T06:27:45.667+00:00

I have a clean Windows 10 x64 virtual machine with dotnet 5.0.2 SDK installed

I created the new project using 'dotnet new console' I edited the .csproj file changing net5 target to netcoreapp3.1 I called 'dotnet build' - its ok I called 'dotnet run' - its failed

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

You can resolve the problem by installing the specified framework and/or SDK.

Does the net5 is back compatible with netcoreapp3 ?

.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,178 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. Michael Taylor 55,461 Reputation points
    2021-01-29T14:56:20.753+00:00

    You cannot run a .NET 3.1 app on the .NET 5 runtime. A 3.1 app requires that you install the runtime for .NET 3.1 as well. Major version changes indicate a new runtime (e.g. .NET Core 2 requires the .NET Core 2.x runtime, .NET Core 3 requires the .NET Core 3.x runtime).

    Note that you can write code for an app that runs on both .NET 3.1 and .NET 5 but they are compiled separately, produce separate binaries and dependencies and the appropriate version would need to be deployed onto the target machine based upon the runtime that is installed.

    0 comments No comments

  2. VICTOR HUGO SÁNCHEZ GRACIDA 1 Reputation point
    2021-01-29T22:13:46.547+00:00

    urllinkId2021#GMT - Desarrolladores | @G&G&G&CO. — Microsoft Q&A - #! - #ContibutionPolicy | by | google.dev https://start.atlassian.com/enterprises-gracida-veracruz/support.app_to?=#!is-it-possible-to-run-netcore-3x-application-under-field-urllink


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.