fix: support robust NuGetize pack delegation for PackFolder=build projects#39
Merged
Conversation
When a project sets NuGetize=true (to use NuGetizer for packaging), avoid importing the real NuGet.Build.Tasks.Pack.targets. This prevents the SDK pack flow from interfering with NuGetizer's own Pack target and inference for PackFolder=build projects. The unconditional import was causing assets to be collected as content instead of build/. This change belongs in the shared oss templates so all consuming repos benefit.
9471d18 to
0c0e035
Compare
github-actions Bot
pushed a commit
to jani-stack/oss
that referenced
this pull request
Jun 25, 2026
# devlooped/oss - Improve default rendering of header icon devlooped@9db26e2 - Update branches for push event in build.yml devlooped@5da103c - Revert indent size for project files devlooped@a62c459 - Refactor GitHub Actions workflows to use unified PR_TOKEN for authentication and add skip PR creation warning devlooped@7c1c6e6 - Ensure dnx run succeeds even on Windows devlooped@7f5f9ee - Skip discussion issues when generating changelog devlooped@08d83cb - Ensure lf for Scriban templates always devlooped@4a9aa32 - Major revamp, focused on GH devlooped@0683ee7 - Cap rate limit wait at 5 minutes, abort if longer devlooped@61a602f - Enhance documentation instructions for project work devlooped@e616d89 - Update to checkout@v4 devlooped@5fb1723 - Fix PackageId default from Pack SDK devlooped@6e24389 - Add 'agent-tools' to .gitignore devlooped@ff61659 - Add OpenTelemetry patterns to dependabot config devlooped@387f061 - Add explicit write permissions from caller workflow devlooped@8fa147d - fix: support robust NuGetize pack delegation for PackFolder=build projects (devlooped#39) devlooped@dcd5f0a - Ignore slnx file format too devlooped@68b409c - If we provide a docs category, don't exclude docs :) devlooped@0c23e24 - Update nuget.config with new(ish?) MS certs devlooped@032439d # devlooped/.github - Add reusable OSMF EULA template devlooped/.github@666a2a7
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.
Problem
Projects using NuGetizer +
PackFolder=build(the standard way to author MSBuild/ tool packages) would get their assets incorrectly placed undercontent/+contentFiles/when packed viadotnet pack.This is the same root cause that affected the nugetizer 1.4.8 release.
Root cause
Directory.Build.targetsalways imported the realNuGet.Build.Tasks.Pack.targets.NuGetize=truepath.PackFolderinference.Fix
And '$(NuGetize)' != 'true'. When a project opts into NuGetizer viaNuGetize, don't pull in the conflicting SDK pack targets.<Target Name="Pack">delegator (after the pack import) that, for any project withPackFolder=buildorbuildTransitive, re-invokes MSBuild withNuGetize=true. This guarantees the correct packaging logic runs.The delegator is declared late in the file so it takes precedence.
See also the consuming change in devlooped/nugetizer#726