none
Unshelve operation fails when moving a folder in TFS that contains a subfolder

    Question

  • I am receiving an error "{Project Folder} cannot be deleted because it is not empty."

    error MSB3073: The command ""c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\..\tf.exe" unshelve "{ShelveSet Name}";"{User Name]" /recursive /noprompt" exited with code 1.

     

    This unshelve fails when you move a folder within your solution to another location.  I checked the folder and found that the "Properties" folder is still present.  Thus it appears that the deletion of the old folder during unshelve is not removing any subfolders and then fails.  As most C# projects contain a properties subfolder where the assemblyInfo.cs file resides, this is causing many problems when reorganizing the project tree in TFS.

     

    Our build automation project uses shelvesets to perform a build validation before we allow a checkin into TFS.  These build scripts use the command line version of TF.exe to perform shelve operations.

     

    To duplicate,

    1. create a simple C# library project and bind it to TFS and check in.
    2. In Team Explorer, right click the folder that was just created that contains the project and 'Move' it to another location.
    3. Shelve your changes into TFS and do not preserve local changes.
    4. Attempt to unshelve your shelveset and you'll receive the above error.  Executing on unshelve from the command line will fail immediately.
    Thursday, May 22, 2008 8:19 PM

Answers

  • It's just a warning, not an error.  Errors set exit code = 100.  In this case, it's happening because the directory contains files
    that are not under TFS's control.  TFS won't remove them from disk for obvious reasons (no way of knowing whether they're important), so it warns you that you may need to cleanup manually.
    Thursday, May 22, 2008 9:25 PM

All replies

  • It's just a warning, not an error.  Errors set exit code = 100.  In this case, it's happening because the directory contains files
    that are not under TFS's control.  TFS won't remove them from disk for obvious reasons (no way of knowing whether they're important), so it warns you that you may need to cleanup manually.
    Thursday, May 22, 2008 9:25 PM
  • Visual Studio will give you a warning message, but the problem is most evident from the command line tool TF.exe.

    Where you perform an unshelve operation "TF.exe unshelve {Shelveset Name};{User Name} /recursive /noprompt

    you will receive the error immediately.

    Thursday, May 22, 2008 9:32 PM