Reputation: 71
As per the title, I want to know if it's possible to set NuGet Package Manager to install any package updates automatically.
I've looked for and found an answer to this on here but it's not specific enough to my situation, I don't think (Question: Is there a way to automatically update an installed NuGet package in Visual Studio?). My code is for automated tests rather than anything that would be released on a regular basis. The only time we'd change any of the code would be to add or amend existing tests.
I'm quite early on in my automated testing career so any advice would be greatly appreciated.
Thanks,
Sheridan
Upvotes: 1
Views: 237
Reputation: 76670
I want to know if it's possible to set NuGet Package Manager to install any package updates automatically.
There is no such option can be set directly to NuGet Package Manager to install nuget package updates automatically. But you could add a simple command in the pre-build event
to achieve it, like:
nuget.exe update "$(ProjectDir)packages.config"
With this pre-build event, VS/MSBuild will update all installed packages in your project when you build your project.
Note:
Since nuget.exe is not a windows internal command, so you should add nuget.exe to the system environment variables, otherwise you should specify the full path of nuget.exe, like:
"C:\Users\<uasername>\nuget.exe" update "$(ProjectDir)packages.config"
.
Upvotes: 1