Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frameworks and Targets update #1721

Merged
merged 13 commits into from
May 1, 2017
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
179 changes: 133 additions & 46 deletions docs/standard/frameworks.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,143 @@
---
title: Frameworks and Targets
description: Explains the concepts of framework targets when writing .NET code.
keywords: .NET, .NET Core
title: Target frameworks | Microsoft Docs
description: Explains the concepts of target frameworks when writing .NET code.
keywords: .NET, .NET Core, framework, tfm
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tfm -> TFM

author: richlander
ms.author: mairaw
ms.date: 09/19/2016
ms.date: 03/13/2017
ms.topic: article
ms.prod: .net
ms.technology: dotnet-standard
ms.devlang: dotnet
ms.assetid: 6ef56a2e-593d-497b-925a-1e25bb6df2e6
---

# Frameworks and Targets

The .NET ecosystem has a concept of frameworks. Frameworks define the API that you can use to target a particular platform. The .NET Framework 4.6 is one of those platforms. Frameworks are used in Visual Studio and other IDEs and editors to provide you with the correct set of APIs. They are also used by NuGet, for both production and consumption of NuGet packages, to ensure that you produce and use appropriate packages (and underlying assets) for the framework you are targeting. One can think of frameworks as one of the key currencies in the .NET ecosystem. The concept is there for correctness, to help you and your customers avoid seeing @System.MissingMethodException and friends at runtime.

## Framework Versions

The table below defines the set of frameworks that you can use, how they are referred to and which version of the [.NET Standard Library](library.md) that they implement.

| Framework | Latest Version | Target Framework Moniker (TFM) | Compact Target Framework Moniker (TFM) | .NET Standard Version | Metapackage |
|:--------: | :--: | :--: | :--: | :--: | :--: | :--: |
| .NET Standard | 1.6 | .NETStandard,Version=1.6 | netstandard1.6 | N/A | [NETStandard.Library](https://www.nuget.org/packages/NETStandard.Library)|
| .NET Core Application | 1.0.1 | .NETCoreApp,Version=1.0 | netcoreapp1.0 | 1.6 | [Microsoft.NETCore.App](https://www.nuget.org/packages/Microsoft.NETCore.App)|
| .NET Framework | 4.6.2 | .NETFramework,Version=4.6.2 | net462 | 1.5 | N/A |

> [!NOTE]
> These framework versions are the latest stable versions. There may be pre-released versions as well that are not described by this table.

## Writing about Frameworks

There are multiple ways to refer to frameworks in written form, most of which are used in this documentation. They are described below, both as a legend for interpreting the documentation but also to guide use in other documents.

Using .NET Framework 4.6.1 as an example, the following forms can be used:

**Referring to a product**

You can refer to a .NET platform or runtime.

- ".NET Framework 4.6.1"

**Referring to a Framework**

You can refer to a framework or targeting of a framework using long- or short-forms of the TFM. Both are equally valid in the general case.

- `.NETFramework,Version=4.6.1`
- `net461`

**Referring to a family of Frameworks**

You can refer to a family of frameworks using long- or short-forms of the framework ID. Both are equally valid in the general case.

- `.NETFramework`
- `net`
# Target frameworks

The .NET ecosystem has a concept of *target frameworks*. Frameworks define the API that you can use to target a particular platform. For example, the .NET Framework 4.6 is a platform that you can target. Visual Studio and other IDEs and editors use frameworks to provide you with the correct set of APIs. NuGet also uses them to ensure that you produce and consume appropriate NuGet packages and underlying assets for the framework you're targeting.

Reference | Name
--- | ---
Product | .NET Framework 4.6.2 or .NET 4.6.2
Framework | `.NETFramework,Version=4.6.2` or `net462`
Family | `.NETFramework` or `net`

## Latest framework versions

The following table defines the set of frameworks that you can use, how they're referenced, and which version of the [.NET Standard Library](library.md) they implement. These framework versions are the latest stable versions. Pre-release versions aren't shown.

Framework | Latest Version | Target Framework Moniker (TFM) | Compact Target Framework Moniker (TFM) | .NET Standard Version | Metapackage
:--------: | :--: | :--: | :--: | :--: | :--: | :--:
.NET Standard | 1.6.1 | .NETStandard,Version=1.6 | netstandard1.6 | N/A | [NETStandard.Library](https://www.nuget.org/packages/NETStandard.Library)
.NET Core Application | 1.1.1 | .NETCoreApp,Version=1.1 | netcoreapp1.1 | 1.6 | [Microsoft.NETCore.App](https://www.nuget.org/packages/Microsoft.NETCore.App)
.NET Framework | 4.6.2 | .NETFramework,Version=4.6.2 | net462 | 1.5 | N/A
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This table doesn't seem to render properly on GitHub (probably caused by the recent GitHub change).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably the exterior pipes ... they aren't technically required, but I already had one table 💥 on me without them. I'll add them back here and see if that does the trick.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found the prob with this ... it's not the exterior pipes ... the columns are literally wrong. I'll fix it.


## Supported frameworks

A framework is typically referenced by a short target framework moniker or *TFM*. In .NET Standard, this is also generalized to *TxM* to allow a single reference to multiple frameworks. The NuGet clients support the following frameworks. Equivalents are shown within brackets (`[]`).

Name | Abbreviation | TFMs/TxMs
--- | --- | ---
.NET Standard | netstandard | netstandard1.0
| | netstandard1.1
| | netstandard1.2
| | netstandard1.3
| | netstandard1.4
| | netstandard1.5
| | netstandard1.6
.NET Core App | netcoreapp | netcoreapp1.0 | netcoreapp1.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.netcoreapp1.1 should be in a new row

.NET Framework | net | net11
| | net20
| | net35
| | net40
| | net403
| | net45
| | net451
| | net452
| | net46
| | net461
| | net462
.NET Core | netcore | netcore [netcore45]
Copy link
Contributor

@mairaw mairaw Mar 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does the netcore TFM is used for? having it identified as .NET Core could be confusing. @terrajobst

Copy link
Contributor Author

@guardrex guardrex Mar 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depreciated .NET Core TFM's? ... that haven't been formally moved to the "depreciated" list yet because some libs perhaps still use them??? wildly guessing

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll wait on @terrajobst help on this one. I think it has to do with UWP.

| | netcore45 [win, win8]
| | netcore451 [win81]
| | netcore50
.NET MicroFramework | netmf | netmf
Windows | win | win [win8, netcore45]
| | win8 [netcore45, win]
| | win81 [netcore451]
| | win10 (not supported by Windows 10 platform)
Silverlight | sl | sl4
| | sl5
Windows Phone | wp | wp [wp7]
| | wp7
| | wp75
| | wp8
| | wp81
| | wpa81
Universal Windows Platform | uap | uap [uap10.0]
| | uap10.0

## Deprecated frameworks

The following frameworks are deprecated. Packages targeting these frameworks should migrate to the indicated replacements.

Deprecated framework | Replacement
--- | ---
aspnet50 | netcoreapp
aspnetcore50 |
dnxcore50 |
dnx |
dnx45 |
dnx451 |
dnx452 |
dotnet | netstandard
dotnet50 |
dotnet51 |
dotnet52 |
dotnet53 |
dotnet54 |
dotnet55 |
dotnet56 |
winrt | win

## Precedence

A number of frameworks are related to and compatible with one another but not necessarily equivalent:

Framework | Can use
--- | ---
uap (Universal Windows Platform) | win81
| | wpa81
| | netcore50
win (Windows Store) | winrt
| | winrt45

## .NET Standard

The [.NET Standard](https://github.com/dotnet/standard) simplifies references between binary-compatible frameworks, allowing a single target framework to reference a combination of others. For background, see the [.NET Standard Library](library.md).

The [NuGet Tools Get Nearest Framework Tool](https://aka.ms/s2m3th) simulates the NuGet logic used for the selection of one framework from many available framework assets in a package based on the project's framework. To use the tool, enter one project framework and one or more package frameworks. Click the **Submit** button. The tool indicates if the package frameworks you list are compatible with the project framework you provide.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to link to version 3.5.0-beta2-1484 of the tool, when versions 3.5.0 and 4.0.0 are available. Shouldn't the link be changed to one of those?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, great catch! I'll fix it. Let's just go with http://nugettoolsdev.azurewebsites.net/, since the latest framework is loaded ✨ auto-magically ✨


For NuGet 3.3 and earlier, use the `dotnet` series of monikers. For NuGet 3.4 and later, use the `netstandard` moniker syntax.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is information on how to use an old version of NuGet still useful?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd remove it since the dotnet ones already show up as deprecated earlier


## Portable Class Libraries
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one is a really long list and we don't even recommend people using it anymore. I think in this case we could link to the NuGet topic (https://docs.microsoft.com/nuget/schema/target-frameworks#portable-class-libraries)


For information on Portable Class Libraries, see the [Portable Class Libraries](https://docs.microsoft.com/nuget/schema/target-frameworks#portable-class-libraries) section of the *Target Framework* topic in the NuGet documentation..

Name | Description | .NET Standard
--- | --- | ---
monoandroid | Mono Support for Android OS | netstandard1.4
monotouch | Mono Support for iOS | netstandard1.4
monomac | Mono Support for OSX | netstandard1.4
xamarinios | Support for Xamarin for iOS | netstandard1.4
xamarinmac | Supports for Xamarin for Mac | netstandard1.4
xamarinpsthree | Support for Xamarin on Playstation 3 | netstandard1.4
xamarinpsfour | Support for Xamarin on Playstation 4 | netstandard1.4
xamarinpsvita | Support for Xamarin on PS Vita | netstandard1.4
xamarinwatchos | Xamarin for Watch OS | netstandard1.4
xamarintvos | Xamarin for TV OS | netstandard1.4
xamarinxboxthreesixty | Xamarin for XBox 360 | netstandard1.4
xamarinxboxone | Xamarin for XBox One | netstandard1.4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this table do here? It doesn't seem to be related to the paragraph right before it. Shouldn't it have some sort of text introduction?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cut what @mairaw said to cut. @mairaw, do you want to cut this one?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this is also part of the PCL section on the NuGet docs


> [!Note]
> Stephen Cleary created a tool that lists the supported PCLs. For more information, see [Framework Profiles in .NET](http://blog.stephencleary.com/2012/05/framework-profiles-in-net.html).