Versions cibles de .NET FrameworkTarget frameworks

NuGet utilise les références des versions cibles de .NET Framework à de nombreux endroits pour identifier et isoler spécifiquement les composants dépendants du framework d’un package :NuGet uses target framework references in a variety of places to specifically identify and isolate framework-dependent components of a package:

  • Manifeste .nuspec : un package peut désigner des packages distincts à inclure dans un projet en fonction de la version cible de .NET Framework du projet..nuspec manifest: A package can indicate distinct packages to be included in a project depending on the project's target framework.
  • Nom du dossier .nupkg : les dossiers à l’intérieur du dossier lib d’un package peuvent être nommés en fonction de la version cible de .NET Framework, chacun contenant les DLL et tout autre contenu appropriés pour ce framework..nupkg folder name: The folders inside a package's lib folder can be named according to the target framework, each of which contains the DLLs and other content appropriate to that framework.
  • packages.config : l’attribut targetframework d’une dépendance spécifie la variante d’un package à installer.packages.config: The targetframework attribute of a dependency specifies the variant of a package to install.

Note

Le code source du client NuGet qui calcule les tableaux ci-dessous se trouve aux emplacements suivants :The NuGet client source code that calculates the tables below is found in the following locations:

Frameworks pris en chargeSupported frameworks

Un framework est généralement référencé par un moniker du Framework cible ou TFM court.A framework is typically referenced by a short target framework moniker or TFM. Dans .NET Standard, ceci est également généralisé sous la forme TxM pour permettre une référence unique à plusieurs frameworks.In .NET Standard this is also is generalized to TxM to allow a single reference to multiple frameworks.

Les clients NuGet prennent en charge les frameworks dans le tableau ci-dessous.The NuGet clients support the frameworks in the table below. Les équivalents sont indiqués entre crochets [].Equivalents are shown within brackets []. Notez que certains outils, tels que dotnet, peuvent utiliser les variantes de monikers TFM canoniques dans certains fichiers.Note that some tools, such as dotnet, might use variations of canonical TFMs in some files. Par exemple, dotnet pack utilise .NETCoreApp2.0 dans un fichier .nuspec plutôt que netcoreapp2.0.For example, dotnet pack uses .NETCoreApp2.0 in a .nuspec file rather than netcoreapp2.0. Les différents outils du client NuGet gèrent correctement ces variantes, mais vous devez toujours utiliser des monikers TFM canoniques quand vous modifiez directement les fichiers.The various NuGet client tools handle these variations properly, but you should always use canonical TFMs when editing files directly.

NameName AbréviationAbbreviation TFMs/TxMsTFMs/TxMs
.NET Framework.NET Framework netnet net11net11
net20net20
net35net35
net40net40
net403net403
net45net45
net451net451
net452net452
net46net46
net461net461
net462net462
net47net47
net471net471
net472net472
Microsoft Store (Windows Store)Microsoft Store (Windows Store) netcorenetcore netcore [netcore45]netcore [netcore45]
netcore45 [win, win8]netcore45 [win, win8]
netcore451 [win81]netcore451 [win81]
netcore50netcore50
.NET MicroFramework.NET MicroFramework netmfnetmf netmfnetmf
WindowsWindows winwin win [win8, netcore45]win [win8, netcore45]
win8 [netcore45, win]win8 [netcore45, win]
win81 [netcore451]win81 [netcore451]
win10 (non pris en charge par la plateforme Windows 10)win10 (not supported by Windows 10 Platform)
SilverlightSilverlight slsl sl4sl4
sl5sl5
Windows Phone (SL)Windows Phone (SL) wpwp wp [wp7]wp [wp7]
wp7wp7
wp75wp75
wp8wp8
wp81wp81
Windows Phone (UWP)Windows Phone (UWP) wpa81wpa81
Plateforme Windows universelleUniversal Windows Platform uapuap uap [uap10.0]uap [uap10.0]
uap10.0uap10.0
.NET Standard.NET Standard netstandardnetstandard netstandard1.0netstandard1.0
netstandard1.1netstandard1.1
netstandard1.2netstandard1.2
netstandard1.3netstandard1.3
netstandard1.4netstandard1.4
netstandard1.5netstandard1.5
netstandard1.6netstandard1.6
netstandard2.0netstandard2.0
Application .NET Core.NET Core App netcoreappnetcoreapp netcoreapp1.0netcoreapp1.0
netcoreapp1.1netcoreapp1.1
netcoreapp2.0netcoreapp2.0
netcoreapp2.1netcoreapp2.1
TizenTizen tizentizen tizen3tizen3
tizen4tizen4

Frameworks dépréciésDeprecated frameworks

Les frameworks suivants sont dépréciés.The following frameworks are deprecated. Les packages ciblant ces frameworks doivent migrer vers les versions de remplacement indiquées.Packages targeting these frameworks should migrate to the indicated replacements.

Framework dépréciéDeprecated framework ReplacementReplacement
aspnet50aspnet50 netcoreappnetcoreapp
aspnetcore50aspnetcore50
dnxcore50dnxcore50
dnxdnx
dnx45dnx45
dnx451dnx451
dnx452dnx452
dotnetdotnet netstandardnetstandard
dotnet50dotnet50
dotnet51dotnet51
dotnet52dotnet52
dotnet53dotnet53
dotnet54dotnet54
dotnet55dotnet55
dotnet56dotnet56
winrtwinrt winwin

PrioritéPrecedence

Un certain nombre de frameworks sont liés et compatibles entre eux, mais sans être nécessairement équivalents :A number of frameworks are related to and compatible with one another, but not necessarily equivalent:

FrameworkFramework Peut utiliserCan use
uap (Plateforme Windows universelle)uap (Universal Windows Platform) win81win81
wpa81wpa81
netcore50netcore50
win (Microsoft Store)win (Microsoft Store) winrtwinrt

.NET StandardNET Platform Standard

.NET Standard Platform simplifie les références entre les frameworks compatibles au niveau binaire, ce qui permet à une même version cible de .NET Framework de référencer une combinaison d’autres frameworks.The .NET Platform Standard simplifies references between binary-compatible frameworks, allowing a single target framework to reference a combination of others. (Pour obtenir des informations générales, consultez le Guide de .NET.)(For background, see the .NET Primer.)

L’outil Get Nearest Framework Nuget simule ce que NuGet utilise pour la sélection d’un framework à partir de nombreuses ressources de framework disponibles dans un package, en fonction du framework du projet.The NuGet Get Nearest Framework Tool simulates what NuGet uses to select one framework from many available framework assets in a package based on the project's framework.

La série dotnet des monikers doit être utilisée dans NuGet 3.3 et versions antérieures ; la syntaxe de moniker netstandard doit être utilisée dans v3.4 et versions ultérieures.The dotnet series of monikers should be used in NuGet 3.3 and earlier; the netstandard moniker syntax should be used in v3.4 and later.

Bibliothèques de classes portablesPortable Class Libraries

Avertissement

Les bibliothèques de classes portables ne sont pas recommandées.PCLs are not recommended. Même si elles sont prises en charge, les auteurs de packages doivent prendre en charge netstandard à la place.Although PCLs are supported, package authors should support netstandard instead. La plateforme .NET Standard est une évolution des bibliothèques de classes portables et représente la portabilité binaire entre plateformes via un moniker unique qui n’est pas lié à une bibliothèque statique comme portable-a + b + c monikers.The .NET Platform Standard is an evolution of PCLs and represents binary portability across platforms using a single moniker that isn't tied to a static library like portable-a+b+c monikers.

Pour définir une version cible de .NET Framework qui fait référence à plusieurs frameworks-cibles-enfants, le mot clé portable est utilisé pour préfixer la liste des frameworks référencés.To define a target framework that refers to multiple child-target-frameworks, the portable keyword use used to prefix the list of referenced frameworks. Évitez d’inclure artificiellement des frameworks supplémentaires qui ne sont pas directement compilés, car cela peut aboutir à des effets secondaires inattendus dans ces frameworks.Avoid artificially including extra frameworks that are not directly compiled against because it can lead to unintended side-effects in those frameworks.

D’autres frameworks définis par des tiers assurent la compatibilité avec d’autres environnements qui sont accessibles de cette manière.Additional frameworks defined by third parties provide compatibility with other environments that are accessible in this manner. De plus, il existe des numéros de profil abrégés qui sont disponibles pour faire référence à ces combinaisons de frameworks connexes en tant que Profile#, mais l’utilisation de ces numéros n’est pas recommandée, car cela réduit la lisibilité des dossiers et de .nuspec.Additionally, there are shorthand profile numbers that are available to reference these combinations of related frameworks as Profile#, but this is not a recommended practice to use these numbers as it reduces the readability of the folders and .nuspec.

Numéro de profilProfile # FrameworksFrameworks Nom completFull name .NET Standard.NET Standard
Profile2Profile2 .NETFramework 4.0.NETFramework 4.0 portable-net40+win8+sl4+wp7portable-net40+win8+sl4+wp7
Windows 8.0Windows 8.0
Silverlight 4.0Silverlight 4.0
WindowsPhone 7.0WindowsPhone 7.0
Profile3Profile3 .NETFramework 4.0.NETFramework 4.0 portable-net40+sl4portable-net40+sl4
Silverlight 4.0Silverlight 4.0
Profile4Profile4 .NETFramework 4.5.NETFramework 4.5 portable-net45+sl4+win8+wp7portable-net45+sl4+win8+wp7
Silverlight 4.0Silverlight 4.0
Windows 8.0Windows 8.0
WindowsPhone 7.0WindowsPhone 7.0
Profile5Profile5 .NETFramework 4.0.NETFramework 4.0 portable-net40+win8portable-net40+win8
Windows 8.0Windows 8.0
Profile6Profile6 .NETFramework 4.0.3.NETFramework 4.0.3 portable-net403+win8portable-net403+win8
Windows 8.0Windows 8.0
Profile7Profile7 .NETFramework 4.5.NETFramework 4.5 portable-net45+win8portable-net45+win8 netstandard1.1netstandard1.1
Windows 8.0Windows 8.0
Profile14Profile14 .NETFramework 4.0.NETFramework 4.0 portable-net40+sl5portable-net40+sl5
Silverlight 5.0Silverlight 5.0
Profile18Profile18 .NETFramework 4.0.3.NETFramework 4.0.3 portable-net403+sl4portable-net403+sl4
Silverlight 4.0Silverlight 4.0
Profile19Profile19 .NETFramework 4.0.3.NETFramework 4.0.3 portable-net403+sl5portable-net403+sl5
Silverlight 5.0Silverlight 5.0
Profile23Profile23 .NETFramework 4.5.NETFramework 4.5 portable-net45+sl4portable-net45+sl4
Silverlight 4.0Silverlight 4.0
Profile24Profile24 .NETFramework 4.5.NETFramework 4.5 portable-net45+sl5portable-net45+sl5
Silverlight 5.0Silverlight 5.0
Profile31Profile31 Windows 8.1Windows 8.1 portable-win81+wp81portable-win81+wp81 netstandard1.0netstandard1.0
WindowsPhone 8.1 (SL)WindowsPhone 8.1 (SL)
Profile32Profile32 Windows 8.1Windows 8.1 portable-win81+wpa81portable-win81+wpa81 netstandard1.2netstandard1.2
WindowsPhone 8.1 (UWP)WindowsPhone 8.1 (UWP)
Profile36Profile36 .NETFramework 4.0.NETFramework 4.0 portable-net40+sl4+win8+wp8portable-net40+sl4+win8+wp8
Silverlight 4.0Silverlight 4.0
Windows 8.0Windows 8.0
WindowsPhone 8.0 (SL)WindowsPhone 8.0 (SL)
Profile37Profile37 .NETFramework 4.0.NETFramework 4.0 portable-net40+sl5+win8portable-net40+sl5+win8
Silverlight 5.0Silverlight 5.0
Windows 8.0Windows 8.0
Profile41Profile41 .NETFramework 4.0.3.NETFramework 4.0.3 portable-net403+sl4+win8portable-net403+sl4+win8
Silverlight 4.0Silverlight 4.0
Windows 8.0Windows 8.0
Profile42Profile42 .NETFramework 4.0.3.NETFramework 4.0.3 portable-net403+sl5+win8portable-net403+sl5+win8
Silverlight 5.0Silverlight 5.0
Windows 8.0Windows 8.0
Profile44Profile44 .NETFramework 4.5.1.NETFramework 4.5.1 portable-net451+win81portable-net451+win81 netstandard1.2netstandard1.2
Windows 8.1Windows 8.1
Profile46Profile46 .NETFramework 4.5.NETFramework 4.5 portable-net45+sl4+win8portable-net45+sl4+win8
Silverlight 4.0Silverlight 4.0
Windows 8.0Windows 8.0
Profile47Profile47 .NETFramework 4.5.NETFramework 4.5 portable-net45+sl5+win8portable-net45+sl5+win8
Silverlight 5.0Silverlight 5.0
Windows 8.0Windows 8.0
Profile49Profile49 .NETFramework 4.5.NETFramework 4.5 portable-net45+wp8portable-net45+wp8 netstandard1.0netstandard1.0
WindowsPhone 8.0 (SL)WindowsPhone 8.0 (SL)
Profile78Profile78 .NETFramework 4.5.NETFramework 4.5 portable-net45+win8+wp8portable-net45+win8+wp8 netstandard1.0netstandard1.0
Windows 8.0Windows 8.0
WindowsPhone 8.0 (SL)WindowsPhone 8.0 (SL)
Profile84Profile84 WindowsPhone 8.1WindowsPhone 8.1 portable-wp81+wpa81portable-wp81+wpa81 netstandard1.0netstandard1.0
WindowsPhone 8.1 (UWP)WindowsPhone 8.1 (UWP)
Profile88Profile88 .NETFramework 4.0.NETFramework 4.0 portable-net40+sl4+win8+wp75portable-net40+sl4+win8+wp75
Silverlight 4.0Silverlight 4.0
Windows 8.0Windows 8.0
WindowsPhone 7.5WindowsPhone 7.5
Profile92Profile92 .NETFramework 4.0.NETFramework 4.0 portable-net40+win8+wpa81portable-net40+win8+wpa81
Windows 8.0Windows 8.0
WindowsPhone 8.1 (UWP)WindowsPhone 8.1 (UWP)
Profile95Profile95 .NETFramework 4.0.3.NETFramework 4.0.3 portable-net403+sl4+win8+wp7portable-net403+sl4+win8+wp7
Silverlight 4.0Silverlight 4.0
Windows 8.0Windows 8.0
WindowsPhone 7.0WindowsPhone 7.0
Profile96Profile96 .NETFramework 4.0.3.NETFramework 4.0.3 portable-net403+sl4+win8+wp75portable-net403+sl4+win8+wp75
Silverlight 4.0Silverlight 4.0
Windows 8.0Windows 8.0
WindowsPhone 7.5WindowsPhone 7.5
Profile102Profile102 .NETFramework 4.0.3.NETFramework 4.0.3 portable-net403+win8+wpa81portable-net403+win8+wpa81
Windows 8.0Windows 8.0
WindowsPhone 8.1 (UWP)WindowsPhone 8.1 (UWP)
Profile104Profile104 .NETFramework 4.5.NETFramework 4.5 portable-net45+sl4+win8+wp75portable-net45+sl4+win8+wp75
Silverlight 4.0Silverlight 4.0
Windows 8.0Windows 8.0
WindowsPhone 7.5WindowsPhone 7.5
Profile111Profile111 .NETFramework 4.5.NETFramework 4.5 portable-net45+win8+wpa81portable-net45+win8+wpa81 netstandard1.1netstandard1.1
Windows 8.0Windows 8.0
WindowsPhone 8.1 (UWP)WindowsPhone 8.1 (UWP)
Profile136Profile136 .NETFramework 4.0.NETFramework 4.0 portable-net40+sl5+win8+wp8portable-net40+sl5+win8+wp8
Silverlight 5.0Silverlight 5.0
Windows 8.0Windows 8.0
WindowsPhone 8.0 (SL)WindowsPhone 8.0 (SL)
Profile143Profile143 .NETFramework 4.0.3.NETFramework 4.0.3 portable-net403+sl4+win8+wp8portable-net403+sl4+win8+wp8
Silverlight 4.0Silverlight 4.0
Windows 8.0Windows 8.0
WindowsPhone 8.0 (SL)WindowsPhone 8.0 (SL)
Profile147Profile147 .NETFramework 4.0.3.NETFramework 4.0.3 portable-net403+sl5+win8+wp8portable-net403+sl5+win8+wp8
Silverlight 5.0Silverlight 5.0
Windows 8.0Windows 8.0
WindowsPhone 8.0 (SL)WindowsPhone 8.0 (SL)
Profile151Profile151 NETFramework 4.5.1NETFramework 4.5.1 portable-net451+win81+wpa81portable-net451+win81+wpa81 netstandard1.2netstandard1.2
Windows 8.1Windows 8.1
WindowsPhone 8.1 (UWP)WindowsPhone 8.1 (UWP)
Profile154Profile154 .NETFramework 4.5.NETFramework 4.5 portable-net45+sl4+win8+wp8portable-net45+sl4+win8+wp8
Silverlight 4.0Silverlight 4.0
Windows 8.0Windows 8.0
WindowsPhone 8.0 (SL)WindowsPhone 8.0 (SL)
Profile157Profile157 Windows 8.1Windows 8.1 portable-win81+wp81+wpa81portable-win81+wp81+wpa81 netstandard1.0netstandard1.0
WindowsPhone 8.1 (SL)WindowsPhone 8.1 (SL)
WindowsPhone 8.1 (UWP)WindowsPhone 8.1 (UWP)
Profile158Profile158 .NETFramework 4.5.NETFramework 4.5 portable-net45+sl5+win8+wp8portable-net45+sl5+win8+wp8
Silverlight 5.0Silverlight 5.0
Windows 8.0Windows 8.0
WindowsPhone 8.0 (SL)WindowsPhone 8.0 (SL)
Profile225Profile225 .NETFramework 4.0.NETFramework 4.0 portable-net40+sl5+win8+wpa81portable-net40+sl5+win8+wpa81
Silverlight 5.0Silverlight 5.0
Windows 8.0Windows 8.0
WindowsPhone 8.1 (UWP)WindowsPhone 8.1 (UWP)
Profile240Profile240 .NETFramework 4.0.3.NETFramework 4.0.3 portable-net403+sl5+win8+wpa8portable-net403+sl5+win8+wpa8
Silverlight 5.0Silverlight 5.0
Windows 8.0Windows 8.0
WindowsPhone 8.1 (UWP)WindowsPhone 8.1 (UWP)
Profile255Profile255 .NETFramework 4.5.NETFramework 4.5 portable-net45+sl5+win8+wpa81portable-net45+sl5+win8+wpa81
Silverlight 5.0Silverlight 5.0
Windows 8.0Windows 8.0
WindowsPhone 8.1 (UWP)WindowsPhone 8.1 (UWP)
Profile259Profile259 .NETFramework 4.5.NETFramework 4.5 portable-net45+win8+wpa81+wp8portable-net45+win8+wpa81+wp8 netstandard1.0netstandard1.0
Windows 8.0Windows 8.0
WindowsPhone 8.1 (UWP)WindowsPhone 8.1 (UWP)
WindowsPhone 8.0 (SL)WindowsPhone 8.0 (SL)
Profile328Profile328 .NETFramework 4.0.NETFramework 4.0 portable-net40+sl5+win8+wpa81+wp8portable-net40+sl5+win8+wpa81+wp8
Silverlight 5.0Silverlight 5.0
Windows 8.0Windows 8.0
WindowsPhone 8.1 (UWP)WindowsPhone 8.1 (UWP)
WindowsPhone 8.0 (SL)WindowsPhone 8.0 (SL)
Profile336Profile336 .NETFramework 4.0.3.NETFramework 4.0.3 portable-net403+sl5+win8+wpa81+wp8portable-net403+sl5+win8+wpa81+wp8
Silverlight 5.0Silverlight 5.0
Windows 8.0Windows 8.0
WindowsPhone 8.1 (UWP)WindowsPhone 8.1 (UWP)
WindowsPhone 8.0 (SL)WindowsPhone 8.0 (SL)
Profile344Profile344 .NETFramework 4.5.NETFramework 4.5 portable-net45+sl5+win8+wpa81+wp8portable-net45+sl5+win8+wpa81+wp8
Silverlight 5.0Silverlight 5.0
Windows 8.0Windows 8.0
WindowsPhone 8.1 (UWP)WindowsPhone 8.1 (UWP)
WindowsPhone 8.0 (SL)WindowsPhone 8.0 (SL)

De plus, les packages NuGet ciblant Xamarin peuvent utiliser d’autres frameworks définis par Xamarin.Additionally, NuGet packages targeting Xamarin can use additional Xamarin-defined frameworks. Consultez Création de packages NuGet pour Xamarin.See Creating NuGet packages for Xamarin.

NameName DescriptionDescription .NET Standard.NET Standard
monoandroidmonoandroid Prise en charge mono pour le système d’exploitation AndroidMono Support for Android OS netstandard1.4netstandard1.4
monotouchmonotouch Prise en charge mono pour iOSMono Support for iOS netstandard1.4netstandard1.4
monomacmonomac Prise en charge mono pour OSXMono Support for OSX netstandard1.4netstandard1.4
xamariniosxamarinios Prise en charge pour Xamarin pour iOSSupport for Xamarin for iOS netstandard1.4netstandard1.4
xamarinmacxamarinmac Prise en charge pour Xamarin pour MacSupports for Xamarin for Mac netstandard1.4netstandard1.4
xamarinpsthreexamarinpsthree Prise en charge pour Xamarin sur Playstation 3Support for Xamarin on Playstation 3 netstandard1.4netstandard1.4
xamarinpsfourxamarinpsfour Prise en charge pour Xamarin sur Playstation 4Support for Xamarin on Playstation 4 netstandard1.4netstandard1.4
xamarinpsvitaxamarinpsvita Prise en charge pour Xamarin sur PS VitaSupport for Xamarin on PS Vita netstandard1.4netstandard1.4
xamarinwatchosxamarinwatchos Xamarin pour le système d’exploitation WatchXamarin for Watch OS netstandard1.4netstandard1.4
xamarintvosxamarintvos Xamarin pour le système d’exploitation TVXamarin for TV OS netstandard1.4netstandard1.4
xamarinxboxthreesixtyxamarinxboxthreesixty Xamarin pour XBox 360Xamarin for XBox 360 netstandard1.4netstandard1.4
xamarinxboxonexamarinxboxone Xamarin pour XBox OneXamarin for XBox One netstandard1.4netstandard1.4

Note

Stephen Cleary a créé un outil qui répertorie les bibliothèques de classes portables prises en charge, que vous pouvez trouver sur son blog, Framework profiles in .NET.Stephen Cleary has created a tool that lists the supported PCLs, which you can find on his post, Framework profiles in .NET.