Skip to content

Commit 660aaa3

Browse files
authored
Add PackageLicenseExpression and PackageLicenseFile (dotnet#9675)
* PackageLicenseUrl is now considered deprecated (see NuGet/Announcements#32 )
2 parents 83d13e1 + b0fa0fa commit 660aaa3

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

docs/core/tools/csproj.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -242,17 +242,29 @@ Path to a license file within the package if you are using a license that hasn
242242
243243
### PackageLicenseUrl
244244

245-
> [!Important]
246-
> PackageLicenseUrl is being deprecated. Use `PackageLicenseFile` or `PackageLicenseExpression` instead.
245+
An URL to the license that is applicable to the package. (_deprecated since Visual Studio 15.9.4, .NET SDK 2.1.502 and 2.2.101_)
247246

248-
An URL to the license that is applicable to the package.
247+
### PackageLicenseExpression
249248

250-
> [!NOTE]
251-
> Only one of `PackageLicenseExpression`, `PackageLicenseFile` and `PackageLicenseUrl` can be specified at a time.
249+
An [SPDX license identifier](https://spdx.org/licenses/) or expression, i.e. `Apache-2.0`.
250+
251+
Replaces `PackageLicenseUrl`, can't be combined with `PackageLicenseFile` and requires Visual Studio 15.9.4, .NET SDK 2.1.502 or 2.2.101, or newer.
252+
253+
### PackageLicenseFile
252254

253-
### PackageProjectUrl
254-
A URL for the package's home page, often shown in UI displays as well as nuget.org.
255+
A path to the license file on disk, relative to the project file, i.e. `LICENSE.txt`.
255256

257+
Replaces `PackageLicenseUrl`, can't be combined with `PackageLicenseExpression` and requires Visual Studio 15.9.4, .NET SDK 2.1.502 or 2.2.101, or newer.
258+
259+
You will need to ensure the license file is packed by adding it explicitly to the project, example usage:
260+
```xml
261+
<PropertyGroup>
262+
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
263+
</PropertyGroup>
264+
<ItemGroup>
265+
<None Include="licenses\LICENSE.txt" Pack="true" PackagePath="$(PackageLicenseFile)"/>
266+
</ItemGroup>
267+
```
256268
### PackageIconUrl
257269
A URL for a 64x64 image with transparent background to use as the icon for the package in UI display.
258270

0 commit comments

Comments
 (0)