Skip to content

Warn on non-standard package IDs in MSBuild pack - #7695

Merged
nkolev92 merged 6 commits into
devfrom
copilot/add-pack-warning-for-package-id
Sep 16, 2026
Merged

nkolev92 merged 6 commits into
devfrom
copilot/add-pack-warning-for-package-id

Conversation

Copilot AI commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Bug

Fixes: NuGet/Home#15013

Description

Emit NU5052 when a non-SDK pack flow uses a package ID outside the restricted character set. This covers both classic MSBuild /t:pack and nuget.exe pack, while SDK-based pack continues to honor the existing SdkAnalysisLevel gate.

The change preserves the existing warning configuration behavior, including NoWarn and warnings-as-errors. Tests cover the SDK analysis-level matrix, nuget.exe pack, and a classic non-SDK project using the repository-built MSBuild pack task and targets.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

Copilot AI changed the title [WIP] Add pack warning for Package ID standards in msbuild /t:pack Warn on non-standard package IDs in MSBuild pack Sep 11, 2026
Copilot AI requested a review from nkolev92 September 11, 2026 00:53
@nkolev92

Copy link
Copy Markdown
Member

@copilot Fix the build errors.

Copilot AI commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Fix the build errors.

Addressed in f57aa60: the new nuget.exe and MSBuild pack warning tests now create packages with content, and the MSBuild test supplies the required Authors metadata.

@nkolev92
nkolev92 marked this pull request as ready for review September 15, 2026 22:56
@nkolev92
nkolev92 requested a review from a team as a code owner September 15, 2026 22:56
@nkolev92
nkolev92 merged commit a5295d7 into dev Sep 16, 2026
17 checks passed
@nkolev92
nkolev92 deleted the copilot/add-pack-warning-for-package-id branch September 16, 2026 14:58
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.

Introduce the pack warning when Package ID doesn't meet the standards in msbuild /t:pack

3 participants