Removing deleted files from TFS 2012 Source Control - visual-studio-2012

I am having issues trying to mark files as 'Delete' that have been deleted from my local machine by an application. The issue is that these files no longer exist so TFS will not process them as 'Deleted'.
I have downloaded the TFS 2012 Power Tools and tried to run 'tfpt.exe online /deletes /recrusive ' but this simply gives me a list of folders that these missing files sit in, not a list of each and every file themselves. This means that when I click 'Pend changes' I get the following error message for each command -
"One or more children have pending changes".
My question is, is anyone aware of a method I can use to carry out this process?

It sounds like tfpt online is detecting that the folders have been deleted. It is trying to pend a delete on those folders, but it sounds like you have already pended different changes on the files within those folders.
tfpt online will not pend a deletion of the folders if you have other changes pended for its children.
If you want to delete the folders, undo the pending changes on their children, make sure that the contents on-disk match what you want, then re-run tfpt online.

If there's not too many files you could run the destroy command in Visual Studio Command Prompt.
Destroys, or permanently deletes, version-controlled items from Team
Foundation version control.
Command
tf destroy $/MyProject/Files/123.cs /collection:http://servername:8080/tfs/myproject

Related

VS 2019 don't delete files immediately

I accidentally deleted a wrong file in Visual Studio 2019 before commiting the changes. I lost not a lot of work but I want to prevent this in future.
Can I setup VS 2019 somehow that files are not immediately deleted but kept in a cache for a while?
Supposedly there is already a backup folder which VS uses for deleted files, but this folder was empty in my case. And also the fact that VS moves files into the Windows bin doesn't help me because my repository is not on the system drive.
Do you know about any settings in VS or is there maybe an extension?
Not exactly what you are looking for but this extension could help you. It migth not prevent the deletion, but give you the opportunity to recover the code.
I haven`t tested it and I am also not sure if it will work with VS2019.
A visual source code plugin for maintaining local history of files.
Every time you modify a file, a copy of the old contents is kept in the local history. At any time, you can compare a file with any older version from the history. It can help you out when you change or delete a file by accident. The history can also help you out when your workspace has a catastrophic problem. Each file revision is stored in a separate file inside the .history folder of your workspace directory (you can also configure another location, see local-history.path).
https://marketplace.visualstudio.com/items?itemName=xyz.local-history
The answer here is to use a version control system (like git) and keep a full history of your project.
Even on simple personal projects it is worth doing.

Source Control on Domino Designer: Files not getting deleted on on-disk project

A weird one here. I've noticed that the 'Team Development - Sync with On-Disk Project' is not deleting files on my ODP. I'm not using automatic updating.
I've looked at the permissions on the odp/nsf folder, and I've noticed a little grey out checkbox which I can remove, but it pops back up immediately.
I've also tried opening up the security on the folder (right-click/properties/Security) and giving most groups superpowers, but no bananas.
Any help or hint would be appreciated.
Update: the deletions happen, but not immediately. I'm confused.
We have had issues not just with deletion but newly added files received via git, the only solution is to refresh both projects a few times and sync them both.
Another issue: I often lose some project settings, i.e. an additional source folder and a .jar file. It probably has something to do with replication, but it's impossible for me to find out exactly why this is happening.

How to check in a new project to Team Foundation Server?

I created a new project in my solution under a newly created folder. Not just a solution folder. It is placed under a physical folder also.
Say, my original solution is like this:
MySolution
- MySolution.Web
- MySolution.Domain
Now the structure is:
MySolution
- App
- MySolution.Web
- Lib
- MySolution.Domain
- MySolution.Repositories
- MySolution.WorkerServices
- Test
- MySolution.Specs
- MySolution.Unit
Please note in addition to the newly added projects, MySolution.Web and MySolution.Domain are moved to a physical subfolder also.
To move MySolution.Web into the App folder, I moved the files outside Visual Studio and then edit the MySolution.sln manually with a text editor so that the project entry can point to the correct physical location.
Since those two projects are almost empty, I don't really care about losing history.
Then I find I could not check in the change to TFS!
I got Team Foundation Error, saying Could not find a part of the path.
As suggested by comments/answers to this question, I have done an Add Items to Folder in my Source Control Explorer. Now the new folders and projects have a plus sign ahead of their icons. But the MySolution.Web and MySolution.Domain still stubbornly exists in the root. If I try to delete them, it says One or more children have pending changes. It appears TFS tracking failed to understand what I am doing and pending changes are related to those projects even though they are not in existence physically on my local computer.
How can I fix it? What is the correct way to add a project into another folder?
It sounds like you need to add these new folders to source control.
In Source Control Explorer, use the tree view and right-click on the folder above the folders you want to add. You should see an "Add Items to Folder" menu item. Click that, and follow the instructions.
Note that all involved folders must be mapped into your workspace in order for this to work.

Can't get workspace project to reflect latest changes tfs visual studio

After using a "GetLatestVersion" to retreive my coworker's new project added to Source Control, we realized that the folder structure was incorrect. He deleted the issues on Source Control and everything looked great there. It runs on his end.
Unfortunately for me, even after running the "GetSpecificVersion" and checking all the overwrite boxes, I cannot get the new version of his project on my local workspace.
Ok.
How now do I delete the project on my end without TFS knowing (so I don't have toCheckInanything and TFS doesn't think it needs to bring anything onto the server from my local workspace).
It makes most sense to me to:
- log out of Source Control, close the project and Visual Studio,
- go into my workspace folder and delete the coworker's broken project
- log back into Source Control, bring up the workspace project in Solution Explorer, and re- "GetLatestVersion" and overwrite files.
Has anyone had this problem before? I'm working in VisualStudio 2012
Are you 100% positive that your co-worker did in fact check in all of his changes that "fixed" it? I would start by double checking that. In team explorer, make certain that they do not have any files that need to be checked in under "Excluded Files".
If you have a TFS Build Server, make certain that the CI build (or you can manually run it) was successful. This will at least prove whether TFS has the project buildng correctly.
If you don't have a TFS build server, have another co-worker pull it down to verify that everything got checked in correctly.
If you are sure that they checked in everything ok and it is still not working for you, try pulling it down to a different directory. Also, you can manually delete your copy of the solution through file explorer and then pull it down again (with the overwrite checked).

Using local TFS workspace for non-VisualStudio source code

I am trying to use TFS storing non-VisualStudio source code. Working with Visual Studio 2012 and Microsoft's online Team Foundation Service.
I've setup a TeamProject and mapped its root to a local folder. All it contains at the moment is a BuildProcessTemplates folder in it. (which was created as part of the TeamProject)
I copied my source code externally (using windows explorer) into the TeamProject root folder on my hard drive and since my TFS workspace is NOT a server workspace but rather a local workspace, I was expecting VS to detect the folders/files and show them in Pending Changes window .... yet it doesn't.
Interestingly, new files in the root folder are detected as "Excluded Changes" but new folders are not detected.
What am I missing?
First make sure the newly added folders contains files.
Are there any Detected changes shown in the Excluded Changes section?
Pending Changes > Detected changes link > The Promote Candidate Changes dialog box appears > check the files you want and click Promote.
I can't say I have ever noticed nor expected TFS to automatically pick up files or folders added to a mapped directory as pending changes.
I always just add them manually using the 'Add existing items' option from the source control view.
It may actually do (or at least be meant to do) the auto-detection, but I can't say I've ever relied on it. I don't think it's something to fret too much about - adding them manually is easy enough, and the 'Add existing items' option is usually smart enough to show you which files are not already under source control, so even if you need to add even more files later, it shouldn't be too much extra effort.

Resources