Suppose I have a project MyLib, under that, I created a folder say Folder1. No file under this folder.
The project is connected to TFS.
Then I want to remove this folder Folder1. I deleted it from context menu and checked the project into TFS.
Then I check the data on TFS with Team Explore->Source Control, Folder1 is deleted.
But it is still there in VS 2010 on local computer.
I closed VS 2020 and deleted Folder1 from widows explore.
Then open VS 2010 again, the Folder1 is still there. I can't remove it locally from MyLib!
Confused. How to resolve this problem?
Simply create a file within the folder and delete it along with the new file. TFS has some problems with empty folders when you try to delete them.
Do the following:
In Visual Studio, open "Solution Explorer".
Right-click on the project in question, and select "Unload Project".
Right-click on the unloaded project (should be grade out), and choose "Edit (Project)".
In the XML Editor (that just opened) search for the problematic folder name (CTRL+F to bring up the "search" window, and search in current document for the folder name).
When the search is done, it should highlight in the XML Editor the XML Node that contains the folder name (most of the times it is in a Node that tells Visual Studio to include the folder in question in the compilation of the project (via MSBuild)). Just delete the node that contains the name of the folder.
Save changes, and close the Editor.
Go back to Solution Explorer, right-click on the grayed-out project, and choose "Reload Project".
Compile and check-in the project. Make sure you delete the physical folder from Windows Explorer (if it's still there).
Edit By Hakam Fostok:
if your project under TFS, then after applying the previous steps you may need to open the Source Controler Explorer and delete the folder from there also
If you right click on the project and select edit project file, you can then delete the entry for the offending folder. After you save and reload the project, you can then delete the folders from your hard drive and then source control.
You can try doing Get Specific version. Right Click parent Folder of the file in Source Control and choose Get Specific version.It will open Get window, here choose Type as Latest Version and check the both available Check box options.
Sorry for the late reply, I missed to check your reply.
The above error suggests that the folder may be Checked out & locked by some other user.
In Source Control, are you able to see the Status of the folder as Checkout & lock?
If yes,can you use Status Sidekick of TFS Sidekicks tool and try to unlock the folder (http://www.attrice.info/cm/tfs/).
Then, try to delete the folder again.
I tried the solution that to add a new file then delete the folder with the file but failed.
My solution was to delete the physical folder first, then sign-in the code to TFS.
(You will see the change list include the deletion of the folder.)
After sign-in, you will be able to delete the folder in your solution explorer.
Just create a file in it (a class file for example) - check in, then after it checks in (successfully) - delete and it will do.
So simply put: check in and then delete and it will work..
Here's what you do: Make a physical folder with the same name in the correct directory of your project. Check everything in. Once they get synched you'll be able to delete the folder from vs and check your program in again.