-
Notifications
You must be signed in to change notification settings - Fork 6k
Update package guidelines for .NET Core 3.0 #13196
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
Merged
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
7ac8513
Update package guidelines for .NET Core 3.0
tmds dfa9f10
Add separate packages for netcoreapp and aspnet, and update names
tmds 101634e
Rename dotnet-netcoreapp-targeting-pack to dotnet-targeting-pack
tmds b9963ff
Align with Microsoft packages
tmds d73b28a
Remove section on preview versions
tmds 0352d9c
Format table into list
tmds 632a09a
Add /etc/dotnet/install_location
tmds 22ad323
Add dotnet-runtime-deps package
tmds 12baa27
Update docs/core/build/distribution-packaging.md
tmds 52b02ee
Update docs/core/build/distribution-packaging.md
tmds 74af8cd
Update docs/core/build/distribution-packaging.md
tmds 073d8ba
Update docs/core/build/distribution-packaging.md
tmds f6f0e93
Update docs/core/build/distribution-packaging.md
tmds e2877b4
Update docs/core/build/distribution-packaging.md
tmds 7aa74f7
Update docs/core/build/distribution-packaging.md
tmds feac66a
Update docs/core/build/distribution-packaging.md
tmds c1f78d0
Update docs/core/build/distribution-packaging.md
tmds bb9a77d
Update docs/core/build/distribution-packaging.md
tmds a84c102
Declare dotnet-runtime-deps optional
tmds 3a2e226
Remove dotnet- prefix from {netstandard,aspnetcore}-targetting-pack
tmds 875e8a9
Remove dotnet-sdk-[major] package
tmds 17e8cb2
Add templates package
tmds 4122e67
Explain package name [major].[minor]
tmds 66ea7bb
Add recommendation to use >= for version requirements
tmds 29291ce
Use sdk version for packages used by the sdk (packs/templates)
tmds 51e87e8
Fix sdk version number
tmds b8c3e47
Tweak some package versions
tmds e8f9126
Apply suggestions from code review
tmds 33b4c5d
Include Microsoft.WindowsDesktop.App
tmds File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,17 +27,34 @@ When installed, .NET Core consists of several components that are laid out as fo | |
├── sdk | ||
│ ├── <sdk version> (3) | ||
│ └── NuGetFallbackFolder (4) | ||
└── shared | ||
├── Microsoft.NETCore.App | ||
│ └── <runtime version> (5) | ||
└── Microsoft.AspNetCore.App | ||
└── <aspnetcore version> (6) | ||
└── Microsoft.AspNetCore.All | ||
└── <aspnetcore version> (7) | ||
├── packs | ||
│ ├── Microsoft.AspNetCore.App.Ref | ||
│ │ └── <aspnetcore ref version> (11) | ||
│ ├── Microsoft.NETCore.App.Ref | ||
│ │ └── <netcore ref version> (12) | ||
│ ├── Microsoft.NETCore.App.Host.<rid> | ||
│ │ └── <apphost version> (13) | ||
│ ├── Microsoft.WindowsDesktop.App.Ref | ||
│ │ └── <desktop ref version> (14) | ||
│ └── NETStandard.Library.Ref | ||
│ └── <netstandard version> (15) | ||
├── shared | ||
│ ├── Microsoft.NETCore.App | ||
│ │ └── <runtime version> (5) | ||
│ ├── Microsoft.AspNetCore.App | ||
│ │ └── <aspnetcore version> (6) | ||
│ ├── Microsoft.AspNetCore.All | ||
│ │ └── <aspnetcore version> (6) | ||
│ └── Microsoft.WindowsDesktop.App | ||
│ └── <desktop app version> (7) | ||
└── templates | ||
│ └── <templates version> (17) | ||
/ | ||
├─usr/share/man/man1 | ||
├── etc/dotnet | ||
│ └── install_location (16) | ||
├── usr/share/man/man1 | ||
│ └── dotnet.1.gz (9) | ||
└─usr/bin | ||
└── usr/bin | ||
└── dotnet (10) | ||
``` | ||
|
||
|
@@ -49,18 +66,32 @@ While there's a single host, most of the other components are in versioned direc | |
|
||
- (3) **sdk/\<sdk version>** The SDK (also known as "the tooling") is a set of managed tools that are used to write and build .NET Core libraries and applications. The SDK includes the .NET Core Command-line interface (CLI), the managed languages compilers, MSBuild, and associated build tasks and targets, NuGet, new project templates, and so on. | ||
|
||
- (4) **sdk/NuGetFallbackFolder** contains a cache of NuGet packages used by an SDK during the restore operation, such as when running `dotnet restore` or `dotnet build /t:Restore`. | ||
- (4) **sdk/NuGetFallbackFolder** contains a cache of NuGet packages used by an SDK during the restore operation, such as when running `dotnet restore` or `dotnet build /t:Restore`. This folder is only used prior to .NET Core 3.0. It can't be built from source, because it contains prebuilt binary assets from `nuget.org`. | ||
|
||
The **shared** folder contains frameworks. A shared framework provides a set of libraries at a central location so they can be used by different applications. | ||
|
||
- (5) **shared/Microsoft.NETCore.App/\<runtime version>** This framework contains the .NET Core runtime and supporting managed libraries. | ||
|
||
- (6,7) **shared/Microsoft.AspNetCore.{App,All}/\<aspnetcore version>** contains the ASP.NET Core libraries. The libraries under `Microsoft.AspNetCore.App` are developed and supported as part of the .NET Core project. The libraries under `Microsoft.AspNetCore.All` are a superset that also contains third-party libraries. | ||
- (6) **shared/Microsoft.AspNetCore.{App,All}/\<aspnetcore version>** contains the ASP.NET Core libraries. The libraries under `Microsoft.AspNetCore.App` are developed and supported as part of the .NET Core project. The libraries under `Microsoft.AspNetCore.All` are a superset that also contains third-party libraries. | ||
|
||
- (7) **shared/Microsoft.Desktop.App/\<desktop app version>** contains the Windows desktop libraries. This isn't included on non-Windows platforms. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should it be noted that some directories/components are available at .NET Core 3.0+? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nevermind ... the title of the doc is 3.0 |
||
|
||
- (8) **LICENSE.txt,ThirdPartyNotices.txt** are the .NET Core license and licenses of third-party libraries used in .NET Core, respectively. | ||
|
||
- (9,10) **dotnet.1.gz, dotnet** `dotnet.1.gz` is the dotnet manual page. `dotnet` is a symlink to the dotnet host(1). These files are installed at well known locations for system integration. | ||
|
||
- (11,12) **Microsoft.NETCore.App.Ref,Microsoft.AspNetCore.App.Ref** describe the API of an `x.y` version of .NET Core and ASP.NET Core respectively. These packs are used when compiling for those target versions. | ||
|
||
- (13) **Microsoft.NETCore.App.Host.\<rid>** contains a native binary for platform `rid`. This binary is a template when compiling a .NET Core application into a native binary for that platform. | ||
|
||
- (14) **Microsoft.WindowsDesktop.App.Ref** describes the API of `x.y` version of Windows Desktop applications. These files are used when compiling for that target. This isn't provided on non-Windows platforms. | ||
tmds marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- (15) **NETStandard.Library.Ref** describes the netstandard `x.y` API. These files are used when compiling for that target. | ||
|
||
- (16) **/etc/dotnet/install_location** is a file that contains the full path to the folder that contains the `dotnet` host binary. The path may be terminated with a newline. It's not necessary to add this file when the root is `/usr/share/dotnet`. | ||
|
||
- (17) **templates** contains the templates used by the SDK. For example, `dotnet new` finds project templates here. | ||
|
||
## Recommended packages | ||
|
||
.NET Core versioning is based on the runtime component `[major].[minor]` version numbers. | ||
|
@@ -70,50 +101,75 @@ For example: SDK version 2.2.302 is the second patch release of the third featur | |
Some of the packages include part of the version number in their name. This allows you to install a specific version. | ||
The rest of the version isn't included in the version name. This allows the OS package manager to update the packages (for example, automatically installing security fixes). Supported package managers are Linux specific. | ||
|
||
The following table shows the recommended packages: | ||
The following lists the recommended packages: | ||
|
||
| Name | Example | Use case: Install ... | Contains | Dependencies | Version | | ||
|-----------------------------------------|------------------------|---------------------------------|--------------------|------------------------------------------------|--------------------| | ||
| dotnet-sdk-[major] | dotnet-sdk-2 | Latest sdk for runtime major | | dotnet-sdk-[major].[latestminor] | \<sdk version> | | ||
| dotnet-sdk-[major].[minor] | dotnet-sdk-2.1 | Latest sdk for specific runtime | | dotnet-sdk-[major].[minor].[latest sdk feat]xx | \<sdk version> | | ||
| dotnet-sdk-[major].[minor].[sdk feat]xx | dotnet-sdk-2.1.3xx | Specific sdk feature release | (3),(4) | aspnetcore-runtime-[major].[minor] | \<sdk version> | | ||
| aspnetcore-runtime-[major].[minor] | aspnetcore-runtime-2.1 | Specific ASP.NET Core runtime | (6),[(7)] | dotnet-runtime-[major].[minor] | \<runtime version> | | ||
| dotnet-runtime-[major].[minor] | dotnet-runtime-2.1 | Specific runtime | (5) | host-fxr:\<runtime version>+ | \<runtime version> | | ||
| dotnet-host-fxr | dotnet-host-fxr | _dependency_ | (2) | host:\<runtime version>+ | \<runtime version> | | ||
| dotnet-host | dotnet-host | _dependency_ | (1),(8),(9),(10) | | \<runtime version> | | ||
* `dotnet-sdk-[major].[minor]` - Installs the latest sdk for specific runtime | ||
* **Version:** \<runtime version> | ||
* **Example:** dotnet-sdk-2.1 | ||
* **Contains:** (3),(4) | ||
* **Dependencies:** `aspnetcore-runtime-[major].[minor]`, `dotnet-targeting-pack-[major].[minor]`, `aspnetcore-targeting-pack-[major].[minor]`, `netstandard-targeting-pack-[netstandard_major].[netstandard_minor]`, `dotnet-apphost-pack-[major].[minor]`, `dotnet-templates-[major].[minor]` | ||
|
||
Most distributions require all artifacts to be built from source. This has some impact on the packages: | ||
* `aspnetcore-runtime-[major].[minor]` - Installs a specific ASP.NET Core runtime | ||
* **Version:** \<aspnetcore runtime version> | ||
* **Example:** aspnetcore-runtime-2.1 | ||
* **Contains:** (6) | ||
* **Dependencies:** `dotnet-runtime-[major].[minor]` | ||
|
||
- The third-party libraries under `shared/Microsoft.AspNetCore.All` can't be easily built from source. So that folder is omitted from the `aspnetcore-runtime` package. | ||
* `dotnet-runtime-deps-[major].[minor]` _(Optional)_ - Installs the dependencies for running self-contained applications | ||
* **Version:** \<runtime version> | ||
* **Example:** dotnet-runtime-deps-2.1 | ||
* **Dependencies:** _distro specific dependencies_ | ||
|
||
- The `NuGetFallbackFolder` is populated using binary artifacts from `nuget.org`. It should remain empty. | ||
* `dotnet-runtime-[major].[minor]` - Installs a specific runtime | ||
* **Version:** \<runtime version> | ||
* **Example:** dotnet-runtime-2.1 | ||
* **Contains:** (5) | ||
* **Dependencies:** `dotnet-hostfxr:<runtime version>+`, `dotnet-runtime-deps-[major].[minor]` | ||
|
||
Multiple `dotnet-sdk` packages may provide the same files for the `NuGetFallbackFolder`. To avoid issues with the package manager, these files should be identical (checksum, modification date, and so on). | ||
* `dotnet-hostfxr` - dependency | ||
* **Version:** \<runtime version> | ||
* **Example:** dotnet-hostfxr | ||
* **Contains:** (2) | ||
* **Dependencies:** `host:<runtime version>+` | ||
|
||
### Preview versions | ||
* `dotnet-host` - dependency | ||
* **Version:** \<runtime version> | ||
* **Example:** dotnet-host | ||
* **Contains:** (1),(8),(9),(10),(16) | ||
|
||
Package maintainers may decide to provide preview versions of the shared framework and SDK. Preview releases may be provided using the `dotnet-sdk-[major].[minor].[sdk feat]xx`, `aspnetcore-runtime-[major].[minor]`, or `dotnet-runtime-[major].[minor]` packages. For preview releases, the package version major must be set to zero. This way, the final release is installed as an upgrade of the package. | ||
* `dotnet-apphost-pack-[major].[minor]` - dependency | ||
* **Version:** \<runtime version> | ||
* **Contains:** (13) | ||
|
||
### Patch packages | ||
* `dotnet-targeting-pack-[major].[minor]` - Allows targeting a non-latest runtime | ||
* **Version:** \<runtime version> | ||
* **Contains:** (12) | ||
|
||
Since a patch version of a package may cause a breaking change, a package maintainer may want to provide _patch packages_. These packages allow you to install a specific patch version that isn't automatically upgraded. Only use patch packages in rare circumstances as they aren't upgraded with (security) fixes. | ||
* `aspnetcore-targeting-pack-[major].[minor]` - Allows targeting a non-latest runtime | ||
* **Version:** \<aspnetcore runtime version> | ||
* **Contains:** (11) | ||
|
||
The following table shows the recommended packages and **patch packages**: | ||
* `netstandard-targeting-pack-[major].[minor]` - Allows targeting a netstandard version | ||
* **Version:** \<sdk version> | ||
* **Contains:** (15) | ||
|
||
| Name | Example | Contains | Dependencies | | ||
|------------------------------------------------|--------------------------|------------------|-----------------------------------------------------------| | ||
| dotnet-sdk-[major] | dotnet-sdk-2 | | dotnet-sdk-[major].[latest sdk minor] | | ||
| dotnet-sdk-[major].[minor] | dotnet-sdk-2.1 | | dotnet-sdk-[major].[minor].[latest sdk feat]xx | | ||
| dotnet-sdk-[major].[minor].[sdk feat]xx | dotnet-sdk-2.1.3xx | | dotnet-sdk-[major].[minor].[latest sdk patch] | | ||
| **dotnet-sdk-[major].[minor].[patch]** | dotnet-sdk-2.1.300 | (3),(4) | aspnetcore-runtime-[major].[minor].[sdk runtime patch] | | ||
| aspnetcore-runtime-[major].[minor] | aspnetcore-runtime-2.1 | | aspnetcore-runtime-[major].[minor].[latest runtime patch] | | ||
| **aspnetcore-runtime-[major].[minor].[patch]** | aspnetcore-runtime-2.1.0 | (6),[(7)] | dotnet-runtime-[major].[minor].[patch] | | ||
| dotnet-runtime-[major].[minor] | dotnet-runtime-2.1 | | dotnet-runtime-[major].[minor].[latest runtime patch] | | ||
| **dotnet-runtime-[major].[minor].[patch]** | dotnet-runtime-2.1.0 | (5) | host-fxr:\<runtime version>+ | | ||
| dotnet-host-fxr | dotnet-host-fxr | (2) | host:\<runtime version>+ | | ||
| dotnet-host | dotnet-host | (1),(8),(9),(10) | | | ||
* `dotnet-templates-[major].[minor]` | ||
* **Version:** \<sdk version> | ||
* **Contains:** (15) | ||
|
||
An alternative to using patch packages is _pinning_ the packages to a specific version using the package manager. To avoid affecting other applications/users, such applications can be built and deployed in a container. | ||
The `dotnet-runtime-deps-[major].[minor]` requires understanding the _distro specific dependencies_. Because the distro build system may be able to derive this automatically, the package is optional, in which case these dependencies are added directly to the `dotnet-runtime-[major].[minor]` package. | ||
|
||
When package content is under a versioned folder, the package name `[major].[minor]` match the versioned folder name. For all packages, except the `netstandard-targeting-pack-[major].[minor]`, this also matches with the .NET Core version. | ||
|
||
Dependencies between packages should use a _equal or greater than_ version requirement. For example, `dotnet-sdk-2.2:2.2.401` requires `aspnetcore-runtime-2.2 >= 2.2.6`. This makes it possible for the user to upgrade their installation via a root package (e.g. `dnf update dotnet-sdk-2.2`). | ||
|
||
Most distributions require all artifacts to be built from source. This has some impact on the packages: | ||
|
||
- The third-party libraries under `shared/Microsoft.AspNetCore.All` can't be easily built from source. So that folder is omitted from the `aspnetcore-runtime` package. | ||
|
||
- The `NuGetFallbackFolder` is populated using binary artifacts from `nuget.org`. It should remain empty. | ||
|
||
Multiple `dotnet-sdk` packages may provide the same files for the `NuGetFallbackFolder`. To avoid issues with the package manager, these files should be identical (checksum, modification date, and so on). | ||
|
||
## Building packages | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.