Skip to content

Replace deprecated PackageLicenseUrl and PackageIconUrl#197

Merged
avgalex merged 2 commits intomasterfrom
fix/issue-144-package-license-expression
Mar 9, 2026
Merged

Replace deprecated PackageLicenseUrl and PackageIconUrl#197
avgalex merged 2 commits intomasterfrom
fix/issue-144-package-license-expression

Conversation

@avgalex
Copy link
Member

@avgalex avgalex commented Mar 9, 2026

Summary

  • Replaces deprecated PackageLicenseUrl with PackageLicenseExpression (MIT) — fixes License information about packages #144
  • Replaces deprecated PackageIconUrl with embedded PackageIcon (NuGet 5.3+ best practice)
  • Adds icon.png (128x128) to the repo root, embedded into NuGet packages

Test plan

  • dotnet build succeeds without NU5048 or license warnings
  • Verify .nupkg metadata contains <license type="expression">MIT</license>
  • Verify .nupkg contains embedded icon.png

🤖 Generated with Claude Code

Fixes #144. Use SPDX license identifier (MIT) instead of deprecated
PackageLicenseUrl so license detection tools like nuget-license can
properly identify the package license type.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@avgalex
Copy link
Member Author

avgalex commented Mar 9, 2026

@claude review this PR

@claude
Copy link

claude bot commented Mar 9, 2026

Claude finished @avgalex's task in 32s —— View job


PR Review: Replace deprecated PackageLicenseUrl with PackageLicenseExpression

  • Read changed files
  • Review the change
  • Post review feedback

Summary

This is a minimal, focused, and correct change. The diff is clean:

- <PackageLicenseUrl>https://github.com/.../blob/master/LICENSE</PackageLicenseUrl>
+ <PackageLicenseExpression>MIT</PackageLicenseExpression>

Verdict: Approved — the change is correct and addresses the issue properly.

What's Good

  • PackageLicenseExpression is the NuGet-recommended way to declare the license using an SPDX identifier (MIT). This allows license detection tools (like nuget-license) to correctly identify the license type from package metadata.
  • The SPDX identifier MIT matches the repository's actual license.
  • The change is minimal with no unintended side effects.

Minor Observation (non-blocking)

src/common.props:8 still uses the deprecated PackageIconUrl:

<PackageIconUrl>https://raw.githubusercontent.com/.../logo_rounded.png</PackageIconUrl>

This has been deprecated since NuGet 5.3 in favor of PackageIcon with an embedded icon file. It's not a blocker for this PR, but worth addressing in a follow-up issue.

Use embedded icon.png instead of deprecated PackageIconUrl property.
This follows NuGet 5.3+ best practices for package icon metadata.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@avgalex avgalex changed the title Replace deprecated PackageLicenseUrl with PackageLicenseExpression Replace deprecated PackageLicenseUrl and PackageIconUrl Mar 9, 2026
@avgalex
Copy link
Member Author

avgalex commented Mar 9, 2026

@claude review this PR

@claude
Copy link

claude bot commented Mar 9, 2026

Claude finished @avgalex's task in 1m 3s —— View job


PR Review: Replace deprecated PackageLicenseUrl and PackageIconUrl

  • Read changed files
  • Review the changes
  • Post review feedback

Summary

This is a clean, focused PR that fully addresses the deprecation warnings. Both changes are correct and follow current NuGet best practices. Approved.


Change 1: PackageLicenseUrlPackageLicenseExpression

- <PackageLicenseUrl>https://github.com/.../blob/master/LICENSE</PackageLicenseUrl>
+ <PackageLicenseExpression>MIT</PackageLicenseExpression>

Correct. MIT is a valid SPDX identifier and matches the repo's actual license. This enables license detection tools (e.g. nuget-license, Dependabot) to correctly classify the package license from metadata alone, without following a URL.


Change 2: PackageIconUrl → embedded PackageIcon

- <PackageIconUrl>https://raw.githubusercontent.com/.../logo_rounded.png</PackageIconUrl>
+ <PackageIcon>icon.png</PackageIcon>
<ItemGroup>
  <None Include="$(MSBuildThisFileDirectory)..\icon.png" Pack="true" PackagePath="" />
</ItemGroup>

Correct. The path $(MSBuildThisFileDirectory)..\icon.png correctly resolves from src/ up to the repo root where icon.png lives. PackagePath="" places the icon at the root of the .nupkg, which is what <PackageIcon>icon.png</PackageIcon> expects.

The added icon.png is a 128×128 PNG with RGBA — this matches NuGet's recommended icon dimensions.


Minor Observations (non-blocking)

  1. Old icon vs new icon: The previous PackageIconUrl pointed to a different upstream image (logo_rounded.png from the micro-elements/MicroElements repo). The new icon.png in this repo root appears to be a different asset. If visual consistency with the old branding matters, this is worth verifying — but it's a cosmetic concern, not a correctness issue.

  2. PackagePath="" — an alternative convention is PackagePath="\" or PackagePath="/". Both "" and \ resolve to the package root and are functionally equivalent. Either works.

  3. The <ItemGroup> with the icon <None> include is placed inside common.props, which is imported by all library .csproj files. This is the right place for it — all packages will embed the icon automatically.


No blocking issues found. The PR is ready to merge.

@avgalex avgalex merged commit de21dea into master Mar 9, 2026
2 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.

License information about packages

1 participant