Reputation: 115
I have many VSTS builds which has reference to one nuget package. Depending on primiary build we have to sometimes to upgrade/downgrade nuget package in VSTS build. We are doing this by copying packages.config with proper version, then we use nuget restore. My problem is that after upgrade/downgrade of nuget package .csproj file still have old version od package reference, so when build starts it still try to search for old reference from .csproj file and build fails.
I there any way to change .csproj file after nuget restore?
Upvotes: 1
Views: 1378
Reputation: 38116
No, there is no way to update the .csproj
during the build. You should change the .csproj
locally and then build in VSTS.
Except the way manually changed the .csproj file, there has an easier way to change package versions correspondingly in .csproj
. Execute below command in Package Manager Console window:
update-package -reinstall
So the workflow to use upgrade/downgrade nuget package version as below:
package.config
file.update-package -reinstall
in in Package Manager Console window.Upvotes: 2