Search code examples
.net.net-core.net-framework-version

.NET Core with .NET Framework as TargetFramework


I'm wondering what it means, exactly, when I have a .NET Core console app project that has its TargetFramework property (in the .csproj) set to a version of the full .NET Framework, e.g.

<TargetFramework>net461</TargetFramework>
  • If I compile this as a console application, will it use the .NET Core runtime, or the .NET Framework runtime?
  • If it uses the .NET Core runtime, can I encounter any incompatibilities between supported features in .NET Core and .NET Framework if I remain on the Windows platform?

Solution

  • If you have <TargetFramework>net461</TargetFramework>, then you don't have a .NET Core console app. You have a .NET Framework app that simply makes use of the newer csproj tweaks in the project file, and which can be easily built with the dotnet command-line tool.