Skip to content

Commit 6bb3ede

Browse files
authored
Merge pull request #13196 from tmds/update_packaging_guidelines
Update package guidelines for .NET Core 3.0
2 parents 9bbd06d + 33b4c5d commit 6bb3ede

File tree

1 file changed

+99
-43
lines changed

1 file changed

+99
-43
lines changed

docs/core/build/distribution-packaging.md

Lines changed: 99 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,34 @@ When installed, .NET Core consists of several components that are laid out as fo
2727
├── sdk
2828
│ ├── <sdk version> (3)
2929
│ └── NuGetFallbackFolder (4)
30-
└── shared
31-
├── Microsoft.NETCore.App
32-
│ └── <runtime version> (5)
33-
└── Microsoft.AspNetCore.App
34-
└── <aspnetcore version> (6)
35-
└── Microsoft.AspNetCore.All
36-
└── <aspnetcore version> (7)
30+
├── packs
31+
│ ├── Microsoft.AspNetCore.App.Ref
32+
│ │ └── <aspnetcore ref version> (11)
33+
│ ├── Microsoft.NETCore.App.Ref
34+
│ │ └── <netcore ref version> (12)
35+
│ ├── Microsoft.NETCore.App.Host.<rid>
36+
│ │ └── <apphost version> (13)
37+
│ ├── Microsoft.WindowsDesktop.App.Ref
38+
│ │ └── <desktop ref version> (14)
39+
│ └── NETStandard.Library.Ref
40+
│ └── <netstandard version> (15)
41+
├── shared
42+
│ ├── Microsoft.NETCore.App
43+
│ │ └── <runtime version> (5)
44+
│ ├── Microsoft.AspNetCore.App
45+
│ │ └── <aspnetcore version> (6)
46+
│ ├── Microsoft.AspNetCore.All
47+
│ │ └── <aspnetcore version> (6)
48+
│ └── Microsoft.WindowsDesktop.App
49+
│ └── <desktop app version> (7)
50+
└── templates
51+
│ └── <templates version> (17)
3752
/
38-
├─usr/share/man/man1
53+
├── etc/dotnet
54+
│ └── install_location (16)
55+
├── usr/share/man/man1
3956
│ └── dotnet.1.gz (9)
40-
└─usr/bin
57+
└─usr/bin
4158
└── dotnet (10)
4259
```
4360

@@ -49,18 +66,32 @@ While there's a single host, most of the other components are in versioned direc
4966

5067
- (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.
5168

52-
- (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`.
69+
- (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`.
5370

5471
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.
5572

5673
- (5) **shared/Microsoft.NETCore.App/\<runtime version>** This framework contains the .NET Core runtime and supporting managed libraries.
5774

58-
- (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.
75+
- (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.
76+
77+
- (7) **shared/Microsoft.Desktop.App/\<desktop app version>** contains the Windows desktop libraries. This isn't included on non-Windows platforms.
5978

6079
- (8) **LICENSE.txt,ThirdPartyNotices.txt** are the .NET Core license and licenses of third-party libraries used in .NET Core, respectively.
6180

6281
- (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.
6382

83+
- (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.
84+
85+
- (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.
86+
87+
- (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.
88+
89+
- (15) **NETStandard.Library.Ref** describes the netstandard `x.y` API. These files are used when compiling for that target.
90+
91+
- (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`.
92+
93+
- (17) **templates** contains the templates used by the SDK. For example, `dotnet new` finds project templates here.
94+
6495
## Recommended packages
6596

6697
.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
70101
Some of the packages include part of the version number in their name. This allows you to install a specific version.
71102
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.
72103

73-
The following table shows the recommended packages:
104+
The following lists the recommended packages:
74105

75-
| Name | Example | Use case: Install ... | Contains | Dependencies | Version |
76-
|-----------------------------------------|------------------------|---------------------------------|--------------------|------------------------------------------------|--------------------|
77-
| dotnet-sdk-[major] | dotnet-sdk-2 | Latest sdk for runtime major | | dotnet-sdk-[major].[latestminor] | \<sdk version> |
78-
| dotnet-sdk-[major].[minor] | dotnet-sdk-2.1 | Latest sdk for specific runtime | | dotnet-sdk-[major].[minor].[latest sdk feat]xx | \<sdk version> |
79-
| dotnet-sdk-[major].[minor].[sdk feat]xx | dotnet-sdk-2.1.3xx | Specific sdk feature release | (3),(4) | aspnetcore-runtime-[major].[minor] | \<sdk version> |
80-
| aspnetcore-runtime-[major].[minor] | aspnetcore-runtime-2.1 | Specific ASP.NET Core runtime | (6),[(7)] | dotnet-runtime-[major].[minor] | \<runtime version> |
81-
| dotnet-runtime-[major].[minor] | dotnet-runtime-2.1 | Specific runtime | (5) | host-fxr:\<runtime version>+ | \<runtime version> |
82-
| dotnet-host-fxr | dotnet-host-fxr | _dependency_ | (2) | host:\<runtime version>+ | \<runtime version> |
83-
| dotnet-host | dotnet-host | _dependency_ | (1),(8),(9),(10) | | \<runtime version> |
106+
* `dotnet-sdk-[major].[minor]` - Installs the latest sdk for specific runtime
107+
* **Version:** \<runtime version>
108+
* **Example:** dotnet-sdk-2.1
109+
* **Contains:** (3),(4)
110+
* **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]`
84111

85-
Most distributions require all artifacts to be built from source. This has some impact on the packages:
112+
* `aspnetcore-runtime-[major].[minor]` - Installs a specific ASP.NET Core runtime
113+
* **Version:** \<aspnetcore runtime version>
114+
* **Example:** aspnetcore-runtime-2.1
115+
* **Contains:** (6)
116+
* **Dependencies:** `dotnet-runtime-[major].[minor]`
86117

87-
- 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.
118+
* `dotnet-runtime-deps-[major].[minor]` _(Optional)_ - Installs the dependencies for running self-contained applications
119+
* **Version:** \<runtime version>
120+
* **Example:** dotnet-runtime-deps-2.1
121+
* **Dependencies:** _distro specific dependencies_
88122

89-
- The `NuGetFallbackFolder` is populated using binary artifacts from `nuget.org`. It should remain empty.
123+
* `dotnet-runtime-[major].[minor]` - Installs a specific runtime
124+
* **Version:** \<runtime version>
125+
* **Example:** dotnet-runtime-2.1
126+
* **Contains:** (5)
127+
* **Dependencies:** `dotnet-hostfxr:<runtime version>+`, `dotnet-runtime-deps-[major].[minor]`
90128

91-
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).
129+
* `dotnet-hostfxr` - dependency
130+
* **Version:** \<runtime version>
131+
* **Example:** dotnet-hostfxr
132+
* **Contains:** (2)
133+
* **Dependencies:** `host:<runtime version>+`
92134

93-
### Preview versions
135+
* `dotnet-host` - dependency
136+
* **Version:** \<runtime version>
137+
* **Example:** dotnet-host
138+
* **Contains:** (1),(8),(9),(10),(16)
94139

95-
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.
140+
* `dotnet-apphost-pack-[major].[minor]` - dependency
141+
* **Version:** \<runtime version>
142+
* **Contains:** (13)
96143

97-
### Patch packages
144+
* `dotnet-targeting-pack-[major].[minor]` - Allows targeting a non-latest runtime
145+
* **Version:** \<runtime version>
146+
* **Contains:** (12)
98147

99-
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.
148+
* `aspnetcore-targeting-pack-[major].[minor]` - Allows targeting a non-latest runtime
149+
* **Version:** \<aspnetcore runtime version>
150+
* **Contains:** (11)
100151

101-
The following table shows the recommended packages and **patch packages**:
152+
* `netstandard-targeting-pack-[major].[minor]` - Allows targeting a netstandard version
153+
* **Version:** \<sdk version>
154+
* **Contains:** (15)
102155

103-
| Name | Example | Contains | Dependencies |
104-
|------------------------------------------------|--------------------------|------------------|-----------------------------------------------------------|
105-
| dotnet-sdk-[major] | dotnet-sdk-2 | | dotnet-sdk-[major].[latest sdk minor] |
106-
| dotnet-sdk-[major].[minor] | dotnet-sdk-2.1 | | dotnet-sdk-[major].[minor].[latest sdk feat]xx |
107-
| dotnet-sdk-[major].[minor].[sdk feat]xx | dotnet-sdk-2.1.3xx | | dotnet-sdk-[major].[minor].[latest sdk patch] |
108-
| **dotnet-sdk-[major].[minor].[patch]** | dotnet-sdk-2.1.300 | (3),(4) | aspnetcore-runtime-[major].[minor].[sdk runtime patch] |
109-
| aspnetcore-runtime-[major].[minor] | aspnetcore-runtime-2.1 | | aspnetcore-runtime-[major].[minor].[latest runtime patch] |
110-
| **aspnetcore-runtime-[major].[minor].[patch]** | aspnetcore-runtime-2.1.0 | (6),[(7)] | dotnet-runtime-[major].[minor].[patch] |
111-
| dotnet-runtime-[major].[minor] | dotnet-runtime-2.1 | | dotnet-runtime-[major].[minor].[latest runtime patch] |
112-
| **dotnet-runtime-[major].[minor].[patch]** | dotnet-runtime-2.1.0 | (5) | host-fxr:\<runtime version>+ |
113-
| dotnet-host-fxr | dotnet-host-fxr | (2) | host:\<runtime version>+ |
114-
| dotnet-host | dotnet-host | (1),(8),(9),(10) | |
156+
* `dotnet-templates-[major].[minor]`
157+
* **Version:** \<sdk version>
158+
* **Contains:** (15)
115159

116-
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.
160+
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.
161+
162+
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.
163+
164+
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`).
165+
166+
Most distributions require all artifacts to be built from source. This has some impact on the packages:
167+
168+
- 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.
169+
170+
- The `NuGetFallbackFolder` is populated using binary artifacts from `nuget.org`. It should remain empty.
171+
172+
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).
117173

118174
## Building packages
119175

0 commit comments

Comments
 (0)