Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.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?
like image 495
Eyvind Avatar asked Jan 31 '18 10:01

Eyvind


People also ask

Is .NET framework compatible with .NET Core?

. NET Framework is compatible only with the Windows operating system. . NET Core is compatible with open-source mobile application platforms, i.e. Xamarin, through the .

Can I install both .NET Core and .NET framework?

NET Core installations are completely independent from the version of . NET Framework. In fact, you can actually install multiple version of . NET Core side-by-side on the same machine (unlike .

Can we migrate .NET framework to .NET Core?

You can migrate your old project to the Core project using the 'dotnet migrate; command, which migrates the project. json and any other files that are required by the web application. The dotnet migrate command will not change your code in any way.

What does Targetframework mean?

When you target a framework in an app or library, you're specifying the set of APIs that you'd like to make available to the app or library. You specify the target framework in your project file using a target framework moniker (TFM). An app or library can target a version of .


1 Answers

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.

like image 71
Marc Gravell Avatar answered Sep 19 '22 01:09

Marc Gravell