bug(#22607) Add Directory.Packages.props and update restore command#22608
Conversation
…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
|
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:
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
left a comment
There was a problem hiding this comment.
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>
|
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 👍 |
There was a problem hiding this comment.
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
…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)
|
@nikolajlauridsen @AndyButland I’m happy to help. |
Updated Dockerfile to include Directory.Packages.props and modified restore command to resolve docker build errors during dotnet restore step. Resolves issue #22607