I use a local TFS 2013 HyperV image for most of my demos and experimentation and so reasonably frequently I break it and just rollback to a snapshot rather than spending time trying to repair it.
This week I wanted to keep some work on there but I’d also broken a collection (on purpose) so my plan was to delete the collection and re-create it (I could have just created a new one but I liked the succinctly named TrainingCollection!)
These are the steps I followed
- Launched the TFS Admin tool and detached TrainingCollection
- Opened SQL Server Management Studio and deleted the Tfs_TrainingCollection database
- Created a new collection called TrainingCollection using TFS Admin
I then created a Team Project and it failed at the Reporting Services stage because a TrainingCollection folder already existed. Oops.
I tried creating the Team project and it failed again, so I had a look in the build creation log
---begin Exception entry---
Event Description: TF30162: Task "WITs" from Group "WorkItemTracking" failed
Exception Type: Microsoft.TeamFoundation.Client.PcwException
Exception Message: TF24016: Cannot find team project 'CustomerTraining'.
--- end Exception entry ---
I realised that I had confused Visual Studio with all my messing around so the way forward was to delete the local TFS Cache so that Visual Studio could forget about the old collection and get to know the new one.
- Closed Visual Studio
- Navigated to my cache folder and deleted the contents.
For my installation it was here:
Obviously, it’ll be slightly different if you’re targeting another version of TFS or if you have installed VS on another drive.
I re-opened Visual Studio and created my Team Project with no further issues.
I don’t suppose this is something you’re likely to run into in a production TFS environment but you never know!