Skip to content

bug(#22607) Add Directory.Packages.props and update restore command#22608

Merged
nikolajlauridsen merged 2 commits into
umbraco:mainfrom
lucky5th:patch-1
Apr 29, 2026
Merged

bug(#22607) Add Directory.Packages.props and update restore command#22608
nikolajlauridsen merged 2 commits into
umbraco:mainfrom
lucky5th:patch-1

Conversation

@lucky5th

Copy link
Copy Markdown
Contributor

Updated Dockerfile to include Directory.Packages.props and modified restore command to resolve docker build errors during dotnet restore step. Resolves issue #22607

…mmand

Updated Dockerfile to include Directory.Packages.props and modified restore command to resolve docker build errors during dotnet restore step. Resolves issue umbraco#22607
@github-actions

Copy link
Copy Markdown

Hi there @lucky5th, thank you for this contribution! 👍

While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of security for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • 💡 The contribution looks original and the contributor is presumably allowed to share it

Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution.

If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@AndyButland AndyButland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching and fixing this @lucky5th. It looks like this file was missed in the update to add support for central package management in #2164.

However, CPM isn't required, it's an option, and now the default option, but it's possible to also have "per project" package references like we had as the only option up to and including 17.2. See the -pm / --package-management option documented here.

Given this is a template, I think you will need to apply a similar <!--#if (UseCPM) --> ... <!--#endif --> and <!--#if (!UseCPM) --> ... <!--#endif --> as you see here for the .csproj file.

That way you can render the appropriate lines depending on which option was selected.

Would you be up for making and testing out that change? Otherwise, if you prefer, we can pick it up from here.

Only copy Directory.Packages.props when CPM is enabled, as per-project
package management users won't have this file in their build context.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nikolajlauridsen

Copy link
Copy Markdown
Contributor

Hey @lucky5th, thanks a lot for the fix. I think you're on the right track and would like to get this cherry-picked into the 17.4 release, so the Docker template works again, so I've taken the liberty of adding the change for you.

I added a condition around the copy statement and left the update to the restore line, since this is fine in both cases. I'll go ahead and test this locally, and then I'll get it merged 👍

@nikolajlauridsen nikolajlauridsen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tested this locally with artefacts from the build server, and it all works well, with and without central package management. Thank you for your contribution @lucky5th, I'll cherry-pick this for 17.4

@nikolajlauridsen nikolajlauridsen merged commit df3cd50 into umbraco:main Apr 29, 2026
28 checks passed
nikolajlauridsen added a commit that referenced this pull request Apr 29, 2026
…22608)

* bug(#22607) Add Directory.Packages.props and update restore command

Updated Dockerfile to include Directory.Packages.props and modified restore command to resolve docker build errors during dotnet restore step. Resolves issue #22607

* fix(template): conditionally copy Directory.Packages.props in Dockerfile

Only copy Directory.Packages.props when CPM is enabled, as per-project
package management users won't have this file in their build context.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: mole <nikolajlauridsen@protonmail.ch>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
(cherry picked from commit df3cd50)
@lucky5th

Copy link
Copy Markdown
Contributor Author

@nikolajlauridsen @AndyButland I’m happy to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants