Repro steps:
1. Create a project.
2. Reference a NuGet package from the project
3. Optionally, enable NuGet package restore for the solution.
4. Check it all into source control (TFS)
5. Go to manage packages for the project and uninstall the NuGet package
6. NuGet will basically do a "tf delete" on packages.config
7. Without checking anything in, reference another NuGet package (or the same one, it doesn't matter) from the project
EXPECTED: The pending "delete" on packages.config will be undone, it will be checked out for edit, and NuGet will update it as appropriate.
ACTUAL: NuGet creates a new packages.config file, but the delete on the old one is still pending. If you try to fix things by undoing the pending delete, TFS will give you this lovely message:
Error
TF10210: Source control encountered an error during undo operation: TF400024: The change on C:\path\to\file\packages.config cannot be undone because a file already exists at C:\path\to\file\packages.config. The file must be deleted from disk for the undo to succeed.
So to fix it, you have to do something like the following:
1. Rename packages.config to something else (ie newpackages.config)
2. Undo pending delete of packages.config
3. Checkout packages.config from TFS
4. Delete packages.config from filesystem
5. Rename newpackages.config back to packages.config
This is pretty painful, especially when it happens to many different projects at the same time. :(
Comments: I tried this out and verified that it's fixed.
1. Create a project.
2. Reference a NuGet package from the project
3. Optionally, enable NuGet package restore for the solution.
4. Check it all into source control (TFS)
5. Go to manage packages for the project and uninstall the NuGet package
6. NuGet will basically do a "tf delete" on packages.config
7. Without checking anything in, reference another NuGet package (or the same one, it doesn't matter) from the project
EXPECTED: The pending "delete" on packages.config will be undone, it will be checked out for edit, and NuGet will update it as appropriate.
ACTUAL: NuGet creates a new packages.config file, but the delete on the old one is still pending. If you try to fix things by undoing the pending delete, TFS will give you this lovely message:
Error
TF10210: Source control encountered an error during undo operation: TF400024: The change on C:\path\to\file\packages.config cannot be undone because a file already exists at C:\path\to\file\packages.config. The file must be deleted from disk for the undo to succeed.
So to fix it, you have to do something like the following:
1. Rename packages.config to something else (ie newpackages.config)
2. Undo pending delete of packages.config
3. Checkout packages.config from TFS
4. Delete packages.config from filesystem
5. Rename newpackages.config back to packages.config
This is pretty painful, especially when it happens to many different projects at the same time. :(
Comments: I tried this out and verified that it's fixed.