We are having issues with NuGet package updates and TFS source control integration lately. This is causing allot of hassles with our team and making us hesitate in adopting NuGet packages fully.
The issue/bug: instead of updating certain projects "package.config" files, they are being removed from the file system (and marked as deleted within TFS source control) I can't work out why.
The behavior we are seeing is the following:
I notice this and Undo Check-Out & get this error:
TF400024: The change on xxx\packages.config cannot be undone because a file already exists at xxx\packages.config. The file must be deleted from disk for the undo to succeed.
The output provided by Package Manager listed below does not indicate any issues for the project in which the package.config was removed.
Updating 'NugetPackageAssemblyA' from version '1.5.18.0' to '1.5.23.0' in project 'CommonUnitTests'. Removed reference 'AssemblyAA.dll' from project 'CommonUnitTests' Removed reference 'AssemblyBB.dll' from project 'CommonUnitTests' Removed reference 'AssemblyCC.dll' from project 'CommonUnitTests' Removed reference 'NugetPackageAssemblyA.dll' from project 'CommonUnitTests' Added file 'packages.config'. Removed file 'packages.config' Successfully removed 'NugetPackageAssemblyA 1.5.18.0' from CommonUnitTests. Added reference 'AssemblyAA' to project 'CommonUnitTests' Added reference 'AssemblyBB' to project 'CommonUnitTests' Added reference 'AssemblyCC' to project 'CommonUnitTests' Added reference 'NugetPackageAssemblyA' to project 'CommonUnitTests' 'packages.config' already exists. Skipping... Successfully added 'NugetPackageAssemblyA 1.5.23.0' to CommonUnitTests.
DEV. Environment Stats:
Is there anything I'm missing?
On the Installed tab, select a package, record its name, then select Uninstall. Switch to the Browse tab, search for the package name, select it, then select Install). For all packages, delete the package folder, then run nuget install .
Well, you should update whenever you are able to cope with it. So you need to think carefully about the regression updating the packages could cause to your application if already in production, or the extra tests you are going to need to carry on in order to verify everything seems to be working as expected.
Right-click the Packages folder in the project, and select Update. This will update the NuGet package to the latest version. You can double-click the Add packages and choose the specific version.
Restore packages manually using Visual StudioEnable package restore by choosing Tools > Options > NuGet Package Manager. Under Package Restore options, select Allow NuGet to download missing packages. In Solution Explorer, right click the solution and select Restore NuGet Packages.
A simple check-in of the code to Visual Studio Online did the trick for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With