51

I have seen various frameworks targeted in project.json files, using names such as netcore50, dotnet, dnx451, net45, and others. The documentation for the "framework" section project.json does not (yet) specify how to use this section for different frameworks.

What frameworks are available and what name should be used in project.json to target each?

natemcmaster
  • 25,673
  • 6
  • 78
  • 100
  • 9
    To the person that voted to close as asking for a software recommendation, this doesn't appear to be what's being asked if you read the question. The questions is about the Target Framework Monikers in ASP.NET 5 (if I got that term right). – mason Jun 10 '15 at 17:57

2 Answers2

66

UPDATE 3

Full list see Target Frameworks.

The most common TFMs ASP.NET app developers need to know are:

  • netcoreappx.y = An application that targets .NET Core x.y (e.g. netcoreapp1.0 = .NET Core 1.0)
  • netstandardx.y = A library that targets .NET Standard x.y. (e.g. netstandard2.0 = .NET Standard 2.0). .NET Standard libraries can work on desktop .NET, Windows Phone, Mono, and others.
  • net4xy = A library or console app that targets desktop .NET Framework 4.x.y (e.g. net452 or net46)

UPDATE 2 (Dec 9, 2015)

Somewhat official docs are now available from dotnet. See .NET Platform Standard → Nuget

For libraries targeting multiple platforms that adhere to the .NET Standard, these TFMs (target framework monikers) are available.~

UPDATE (Aug 12, 2015)

This Nuget blog post shows additional TFMs available for nuget. It also explains the dotnet TFM.

Original response

Although this is not official documentation, this blog post by Oren Novotny has an excellent table showing the different target framework monikers.

David Roberts
  • 467
  • 4
  • 18
natemcmaster
  • 25,673
  • 6
  • 78
  • 100
1

As of right now there are only two three with any package support.

.Net Framework 4.5.1 = dnx451 .Net Framework 4.5.2 = dnx452 .Net Core 5.0 = dnx50

.NET Framework 4.6.0 (dnx46) will be released in the near future.

Still it depends on what you mean by 'available'. Anyone could release a new framework is they wanted to, that cat is now out of the bag. However by default dnu uses the project.json to find dependencies by looking at the main feed on nuget.org. Right now on nuget.org those are the only dnx framework dependencies.

For example take a look at the microsoft.aspnet.mvc nuget page: https://www.nuget.org/packages/Microsoft.AspNet.Mvc/6.0.0-beta4

Dependencies

DNX 4.5.1
Microsoft.AspNet.Authorization (≥ 1.0.0-beta4)
Microsoft.AspNet.Cors (≥ 1.0.0-beta4)
Microsoft.AspNet.Mvc.Razor (≥ 6.0.0-beta4)
Microsoft.Framework.Caching.Memory (≥ 1.0.0-beta4)

DNXCore 5.0
Microsoft.AspNet.Authorization (≥ 1.0.0-beta4)
Microsoft.AspNet.Cors (≥ 1.0.0-beta4)
Microsoft.AspNet.Mvc.Razor (≥ 6.0.0-beta4)
Microsoft.Framework.Caching.Memory (≥ 1.0.0-beta4)

Edit: there also was a aspnet50 and aspnetcore50 in earlier beta versions but they have been deprecated and should be replaced with dnx451 and dnxcore50 respectively.

Gerald Davis
  • 4,541
  • 2
  • 31
  • 47
  • There are definitely more than two. MVC only uses 2. – natemcmaster Jun 10 '15 at 21:13
  • You stated packages.json which would indicates dnx environment correct? There are lots of FTMs but they are not valid targets for dnx. In addition to the two listed there is also dnx452 and dnx460 will probably be the primary non-core target by the time VS reaches RTM. – Gerald Davis Jun 10 '15 at 22:33
  • 2
    just published a package on nugget and .Net Framework 4.5.1 != dnx451. `dnx451` is .Net Framework 4.5.1 over the dnx execution environment while `net451` is .Net Framework 4.5.1 classic. – cleftheris Sep 21 '15 at 08:10
  • The term DNX has officially been removed, so hope this answer can be updated accordingly. – Lex Li Aug 13 '16 at 11:31