Brandon Runyon
Brandon Runyon

Reputation: 231

Using Team Foundation Server on a development web site

We'd like to start using Team Foundation Server to keep track of versions of .aspx files. We currently use a shared drive to develop on a asp.net site with visual studio as an editor.

When we set up our paths in Team Foundation Server, it's just between our local drive and the box with TFS. This is not ideal because it doesn't push the changes live to our development site (separate box).

Is there a way to check out, edit, and check in the files we work on so they also appear on our shared drive on IIS server? Or do we have to work on them locally and then copy them back to the server?

Upvotes: 2

Views: 752

Answers (1)

James Reed
James Reed

Reputation: 14052

There are several options.

  1. Simple: use something like Robocopy to push the files to the dev server from your local machine to the dev server once you've checked in your changes. This would be simple to set up but doesn't utilise the full TFS capability and you could potentially overwrite other devs changes on the server.

  2. Advanced: Use an Automated build. If you use the "Default" build template this will compile your web site solution and in the build output you will have a folder that contains folder called "published websites" this will contains everything you need to deploy your code to a server. Once you have this you could use MSDeploy to publish the code to IIS

Other advantages to using a build

  • You can run Code Analysis against the code on each build
  • You know instantly when someone checks in code that doesn't compile
  • You can run unit tests against your code on the build environment
  • To get on to the server you must check in, therefore you can be confident that you haven't published code that didn't get checked in to Source Control
  • You can compile in both Debug and Release mode in the same build, reducing the risk of debug code shipping
  • You can get reports on things like Code Churn, Unit Test Code Coverage and Build Failures which will help improve the quality of the code you deliver and also help you understand weaknesses in your development workflow.
  • Reduce the number of times you hear "It works on my machine"

If you're new to TFS then this can be quite daunting. I suggest that you set up an Automated build that does nothing more than build your solution. You can then copy the build output to the dev server. Once you're comfortable with that then start to look at enhancing the build. e.g. turning on Code Analysis is really easy. If you're writing unit tests they should also be fairly easy to integrate in to the build. Setting up MSDeploy takes a bit more time and knowledge.

Upvotes: 2

Related Questions