Embed LICENSE.txt in NuGet packages#362
Merged
Merged
Conversation
Closed
Copilot
AI
changed the title
[WIP] Embed license in NuGet package output
Embed LICENSE.txt in NuGet packages
Jul 9, 2026
DecSmith42
approved these changes
Jul 9, 2026
Contributor
There was a problem hiding this comment.
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
PackageLicenseFileto the shared packing metadata. - Packs
LICENSE.txtinto the root of generated.nupkgfiles (matching the existing icon/readme packing pattern).
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).
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.
This was referenced Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NuGet packages built from this repo did not include the
LICENSE.txtfile, relying instead on the deprecatedlicenseUrlmetadata field.Packaging metadata
PackageLicenseFilepointing toLICENSE.txtinDirectory.Build.props, alongside the existingPackageReadmeFile/PackageIconsettings.LICENSE.txtas a packed content item (Pack="true" PackagePath="\"), following the same pattern already used forreadme.mdandicon.png.Since these settings live in the shared
Directory.Build.props, every project undersrc/picks up the change automatically — no per-project edits needed.Verified locally via
dotnet packthat the resulting.nupkgnow containsLICENSE.txtat the package root, and the.nuspecreports<license type="file">LICENSE.txt</license>instead of the deprecated license URL.