Repository navigation
[repo-assist] Prefer MSBuild PackageId property when resolving pack id (fixes #3195) - #4360
Merged
dsyme merged 1 commit intoAug 26, 2026
Merged
Conversation
Closes #3195 Fixes 'paket pack' generating a nupkg named after the assembly instead of respecting the MSBuild <PackageId> property, matching 'dotnet pack' behavior. Co-authored-by: Copilot <[email protected]>
dsyme
marked this pull request as ready for review
August 26, 2026 18:44
This was referenced Oct 5, 2026
This was referenced Oct 14, 2026
This was referenced Nov 11, 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.
🤖 This PR was created automatically by Repo Assist, an AI assistant.
Root cause
paket packderives the package id from the assembly name (ProjectFile.GetAssemblyName()) when thepaket.templatefile doesn't explicitly set anid. It never looked at the MSBuildPackageIdproperty, so projects that set<PackageId>in the.csproj/.fsproj(e.g. to override an assembly name likeAssemblyNamewith aWpfAnalyzers-clean name) still got a package named after the assembly, unlikedotnet packwhich honorsPackageId.Fix
Added
PackageProcess.resolveProjectId, used inmerge, which resolves the id in this priority order:PackageIdproperty read viaProjectFile.GetProperty "PackageId"This is a minimal, additive change — no existing behavior changes unless
PackageIdis set and the template doesn't already specify an id.Trade-offs
PackageIdMSBuild property as-is (no evaluation of MSBuild property functions/conditions beyond whatProjectFile.GetPropertyalready supports for other properties in this codebase).Test Status
dotnet build src/Paket.Core/Paket.Core.fsproj -f netstandard2.0— succeeded, 0 errors.dotnet test tests/Paket.Tests/Paket.Tests.fsproj -f net9 --filter "FullyQualifiedName~PackagingProcess"— 3/3 new tests forresolveProjectIdpassed. The pre-existingLoading assembly metadata workstest fails in this sandbox for both before/after this change (missing net461 build output at test time), unrelated to this fix.Closes #3195
Add this agentic workflow to your repo
To install this agentic workflow, run