Skip to content
Apr 12 2007

How To Exclude Files from TFS Source Control

A few days ago I wrote a post advising you to *not* put the Visual Studio .vsmdi file under source control. If you’re wondering how to do this using Team Foundation Server, you’ve got a couple options:

  1. Assuming you have the necessary permissions, in Team Explorer right-click on the root server name, hover over Team Foundation Server Settings, then select Source Control File Types. A window opens listing all of the file types TFS recognizes out-of-the-box. Simply select the file type(s) you want to exclude from source control and click the Remove button (as for the .vsmdi file, it’s part of Visual Studio Team Test Files). IMPORTANT NOTE: This is for all projects on the TFS server.
  2. Assuming your Visual Studio solutions/projects are under TFS source control, in Solution Explorer select the specific file within your solution that you want to exclude from source control (as in, just click it once). On the VS menu click File, hover over Source Control, then click Exclude [Filename] from Source Control. After a second or two you’ll see the icon change next to that file indicating it is no longer under source control.

Oddly enough, there is no option (that I can find) in TFS that allows you to exclude specific file types from source control at the project level. It’s either at the server level for all projects or on an individual file basis within Visual Studio projects, but nothing in between (if anyone knows differently, please let me know).

Similar Posts:

  • http://www.allenringgold.com Allen

    Thanks, I was trying to figure out why right-clicking the file didn’t show the option, though I knew it existed. Thumbs-up

  • Jonrgrover

    this does not work. I have tried to remove both pdb files and dll files and TFS still tires to check them in.