Skip to content

Use PackageLicenseExpression in packages built from this repo #312

@KalleOlaviNiemitalo

Description

@KalleOlaviNiemitalo

The SDK packages published from this repo include a LICENSE.txt file, which contains the text of the MIT license:

<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageLicensePath>$(MSBuildThisFileDirectory)$(PackageLicenseFile)</PackageLicensePath>

However, https://docs.microsoft.com/en-us/nuget/reference/nuspec#license recommends that MIT-licensed packages should have <license type="expression">MIT</license> instead of referring to a file. In Directory.Build.targets, that would be <PackageLicenseExpression>MIT</PackageLicenseExpression>. I believe that would let the NuGet Gallery pages for Microsoft.Build.NoTargets and other packages display the text "MIT license", like the page for Microsoft.Extensions.Logging.Abstractions already does.

LICENSE.txt does contain a copyright notice that would not be covered by <license type="expression">MIT</license>:

Copyright (c) Microsoft Corporation. All rights reserved.

However, almost the same copyright notice is already in the copyright element of the generated nuspec, so omitting the copyright notice from the license element seems OK. I believe it comes from the Copyright property that Directory.Build.targets sets:

<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions