EvilDr
EvilDr

Reputation: 9580

Deleted project folders/files remain in VSO/TFVC and the file system

I had a solution containing the following projects:

  1. Web App 01
  2. Server Control Foo
  3. Server Control Bar

Each project has its own directory in the root of the solution directory, directly mirroring the structure of the solution.

I branched the solution, then combined items 2 & 3 into a new project within that solution, then deleted projects 2 & 3. I committed the changeset. The resulting structure in VS2015 solution explorer was this:

  1. Web App 01
  2. Server Control Library

I then merged the branch, and committed this also. Over time, branching and merging has got slower and slower. On inspecting the file structure of my hard drive, and Visual Studio Online, I see this folder structure:

Despite Solution Explorer not listing the deleted projects, the folders and files from all my deleted projects remain. Despite their status, they are also being branched every time. Is this the correct behaviour, and is it safe to delete them? If so, should I delete using VSO, Windows, or VS2015?

Upvotes: 0

Views: 2020

Answers (1)

starian chen-MSFT
starian chen-MSFT

Reputation: 33708

I assume you are using TFVC (changeset, branched the solution). First, delete the projects from solution (right click the project in VS > Remove) just remove the relationship between projects and solution, the projects’ files and folder are still existing in the hard drive. So you need to delete these files and folders from hard drive (file system).

Secondly, these files are still existing in the source control too, because they aren’t marked as deleted if you just remove projects from solution, so check in changes just affect the solution file, it won’t delete files from source control. So you need to delete them from source control and it’s safe.
Steps to delete files:

  1. Go to Source Control Explorer in VS
  2. Right click Folder or file > Delete
  3. Check in changes

BTW, the files still can be restored if you don’t permanently destroy them. (Destroy command), more information, you can refer to this article: Delete or restore files and folders in Team Foundation Version Control (TFVC)

Upvotes: 1

Related Questions