Skip to content

Clarification on the MSBuild property RestorePackagesConfig #13534

Closed Answered by zivkan
Bartleby2718 asked this question in Q&A
Discussion options

You must be logged in to vote
  1. yes, msbuild works on SDK style projects. I think of Visual Studio as a GUI on top of MSBuild, so in most (but unfortunately not all) cases, if it works in VS, it'll probably work on the CLI with msbuild.

  2. msbuild restore of packages.config doesn't work on a per-project setting. It needs to be passed into Nuget's RestoreTask. This is why I specified the -p:RestorePackagesConfig=true on the command line, which personally I recommend in CI scripts as well, but that's just my personal preference. But in theory copying that Directory.Build.props example to Directory.Solution.props will work: https://learn.microsoft.com/en-us/visualstudio/msbuild/customize-solution-build?view=vs-2022

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Bartleby2718
Comment options

@zivkan
Comment options

Answer selected by Bartleby2718
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants