Skip to content

Commit f1cd0ce

Browse files
vbfoxBillWagner
authored andcommitted
Add license properties to csproj documentation (dotnet#9390)
Part of the text is from the equivalent tag in [nuspec documentation](https://docs.microsoft.com/en-us/nuget/reference/nuspec#license) NuGet change is NuGet/Home#4628 released in SDK 2.1.500
1 parent dfb238a commit f1cd0ce

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

docs/core/tools/csproj.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,49 @@ Copyright details for the package.
205205
### PackageRequireLicenseAcceptance
206206
A Boolean value that specifies whether the client must prompt the consumer to accept the package license before installing the package. The default is `false`.
207207

208+
### PackageLicenseExpression
209+
210+
An SPDX license expression or path to a license file within the package, often shown in UI displays as well as nuget.org.
211+
212+
Here is the complete list of [SPDX license identifiers](https://spdx.org/licenses/). NuGet.org accepts only OSI or FSF approved licenses when using license type expression.
213+
214+
The exact syntax of the license expressions is described below in [ABNF](https://tools.ietf.org/html/rfc5234).
215+
```cli
216+
license-id = <short form license identifier from https://spdx.org/spdx-specification-21-web-version#h.luq9dgcle9mo>
217+
218+
license-exception-id = <short form license exception identifier from https://spdx.org/spdx-specification-21-web-version#h.ruv3yl8g6czd>
219+
220+
simple-expression = license-id / license-id”+”
221+
222+
compound-expression = 1*1(simple-expression /
223+
simple-expression "WITH" license-exception-id /
224+
compound-expression "AND" compound-expression /
225+
compound-expression "OR" compound-expression ) /
226+
"(" compound-expression ")" )
227+
228+
license-expression = 1*1(simple-expression / compound-expression / UNLICENSED)
229+
```
230+
231+
> [!NOTE]
232+
> Only one of `PackageLicenseExpression`, `PackageLicenseFile` and `PackageLicenseUrl` can be specified at a time.
233+
234+
### PackageLicenseFile
235+
236+
Path to a license file within the package if you are using a license that hasn’t been assigned an SPDX identifier, or it is a custom license (Otherwise `PackageLicenseExpression` is prefered)
237+
238+
> [!NOTE]
239+
> Only one of `PackageLicenseExpression`, `PackageLicenseFile` and `PackageLicenseUrl` can be specified at a time.
240+
208241
### PackageLicenseUrl
242+
243+
> [!Important]
244+
> PackageLicenseUrl is being deprecated. Use `PackageLicenseFile` or `PackageLicenseExpression` instead.
245+
209246
An URL to the license that is applicable to the package.
210247

248+
> [!NOTE]
249+
> Only one of `PackageLicenseExpression`, `PackageLicenseFile` and `PackageLicenseUrl` can be specified at a time.
250+
211251
### PackageProjectUrl
212252
A URL for the package's home page, often shown in UI displays as well as nuget.org.
213253

0 commit comments

Comments
 (0)