Reputation: 683
I am new to Nuget and have added a Nuget restore step to install dependencies on the build server. When I looked up the Nuget restore, we need the Nuget.config file under the solution folder as well as in the local build machine where the build will be running. %Appdata%/Nuget/Nuget.config
My question is do the two nuget.config files need to match? Does the nuget.config file in the source repository replace the nuget.config in the build server during the build?
Upvotes: 0
Views: 404
Reputation: 19016
Do the two nuget.config files need to match?
For this question, the answer is No, they do not need be matched. As the doc defined:
While you enable this checkbox and execute this restore task, the server will just get the config file which has been under the repository source control. The config file which exists in your local build agent will not has any affect about this file. So, they don't need be matched.
Does the nuget.config file in the source repository replace the nuget.config in the build server during the build?
Yes, if the local config file has the same argument configuration with the one in repos, while the build running, the local one will be override by the file which in repos because of proximity principle.
For example, if you configured some about feed in the config file which in repos, but the local file does not. While the build running, the local file need use this value since the build server will take the local file.
So, for this question, the nuget.config file in the repository will override the nuget.config in the build server during the build. And also, the precondition about this is these two config file has the same argument configuration.
Upvotes: 1