Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2015 target framework "dotnet" vs "net452"

When creating a new Visual Studio 2015 class library (package) project, one is able to set multiple target frameworks.

What is the difference between dotnet and net452?

project.json:

"frameworks": {
  "dotnet": { },
  "net452": {}
}

Project layout:

Target Frameworks

like image 264
Dave New Avatar asked Jul 28 '15 12:07

Dave New


2 Answers

dotnet: The new .NET Core for packages that don’t have any app model requirement, this is the runtime. (You could also use use dnx or dnxcore for example)

net452: This need to be referenced if you want something that is only part of the full .net framework.

Oren Novotny has a great blog post explaining it.

like image 111
thllbrg Avatar answered Oct 24 '22 23:10

thllbrg


I cannot answer to the previous answer from thllbrg (which is roughly right ... Also Oren blog post is the most important source at the current time), but one important clarification: dotnet does not have a runtime.

Libraries build with dotnet can deploy the DNX, .Net Framework and the UWP platforms (if the dependencies of your libraries allow so). All have different CLRs and compilation models. DNX e.g. support compilation on the fly, while UWP compiles ahead of time into one file and does tree shaking (the killing of not used functions in your library).

like image 21
Thomas Avatar answered Oct 25 '22 01:10

Thomas