Skip to content

Embed LICENSE.txt in NuGet packages#362

Merged
DecSmith42 merged 6 commits into
mainfrom
copilot/embed-license-in-nuget
Jul 9, 2026
Merged

Embed LICENSE.txt in NuGet packages#362
DecSmith42 merged 6 commits into
mainfrom
copilot/embed-license-in-nuget

Conversation

Copilot AI commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

NuGet packages built from this repo did not include the LICENSE.txt file, relying instead on the deprecated licenseUrl metadata field.

Packaging metadata

  • Added PackageLicenseFile pointing to LICENSE.txt in Directory.Build.props, alongside the existing PackageReadmeFile/PackageIcon settings.
  • Included LICENSE.txt as a packed content item (Pack="true" PackagePath="\"), following the same pattern already used for readme.md and icon.png.

Since these settings live in the shared Directory.Build.props, every project under src/ picks up the change automatically — no per-project edits needed.

Verified locally via dotnet pack that the resulting .nupkg now contains LICENSE.txt at the package root, and the .nuspec reports <license type="file">LICENSE.txt</license> instead of the deprecated license URL.

Copilot AI requested review from Copilot and removed request for Copilot July 9, 2026 11:56
Copilot AI linked an issue Jul 9, 2026 that may be closed by this pull request
Copilot AI requested review from Copilot and removed request for Copilot July 9, 2026 11:58
Copilot AI changed the title [WIP] Embed license in NuGet package output Embed LICENSE.txt in NuGet packages Jul 9, 2026
Copilot AI requested a review from DecSmith42 July 9, 2026 11:59
@DecSmith42 DecSmith42 marked this pull request as ready for review July 9, 2026 12:00
Copilot AI review requested due to automatic review settings July 9, 2026 12:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the repository-wide NuGet packing metadata so packages embed a license file (LICENSE.txt) via PackageLicenseFile, avoiding reliance on deprecated licenseUrl metadata.

Changes:

  • Adds PackageLicenseFile to the shared packing metadata.
  • Packs LICENSE.txt into the root of generated .nupkg files (matching the existing icon/readme packing pattern).

Comment thread Directory.Build.props Outdated
Updated `PackageReadmeFile` to use the correct casing (`README.md`). Adjusted paths for included files (`icon.png`, `README.md`, and `LICENSE.txt`) to ensure consistency with `MSBuildThisFileDirectory`.
Updated Verify.NUnit package in multiple test projects to version 31.22.0 for consistency and latest enhancements. No breaking changes expected.
Removed packaging configuration for `icon.png` and `readme.md` from the project file as they are no longer required. Updated LICENSE.txt to reflect the extended copyright period (2024-2026).
Copilot AI review requested due to automatic review settings July 9, 2026 12:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Added a `.gitattributes` file to enforce LF line endings for files with `.verified.txt` and `.received.txt` extensions. Aims to ensure consistency across different environments.
Copilot AI review requested due to automatic review settings July 9, 2026 12:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

@DecSmith42 DecSmith42 merged commit ab0cca3 into main Jul 9, 2026
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Embed license in nuget

3 participants