Adding a project to Team Foundation Service
Over the weekend I spent a few hours building a demo web application, and I wanted to deploy it to an Azure website. So I set up a Team Foundation Service project, and a new Azure website linked to that repository. The beauty about setting it up this way is that every time you check your code in to TFS, it automatically builds and (depending on the success of the build) deploys your code to the Azure website, giving you Continuous Integration pretty much straight out of the box!
In theory this should have been a relatively simple thing to set up. I’ve done it a few times before and I use TFS on a daily basis. However this time something went badly wrong and it took me quite some time to get this demo website checked in to TFS!
Here’s a few things I learned during my epic struggle with TFS:
- It’s really difficult to add a local project to a TFS project (or at least it was for me!)
- It’s really difficult to delete a project from TFS once you’ve created it! (check this article I found which explains how to do it)
- It’s a very bad idea to delete the .vssscc file that sits in your solution’s root directory! This is the source control file that TFS uses, and deleting it causes all sorts of problems…
- At the point you start getting into a mess with any source control repository, it’s easier to create a new project and start again than it is to try and figure out what’s going on!
Finally I figured out how to make this work, so here’s how to create a TFS solution that continuously builds and deploys to a Windows Azure website: