14
votes

I've just started using Subversion with ASP.NET web applications via the VisualSVN IDE plugin. There are a bunch of files which Visual Studio automatically generates so I don't want to version control these since they're not really part of the codebase and not required to build.

Does anyone have a definitive list of the main files that should be ignored when commiting to Subversion from an ASP.NET Web Application? and how would I go about ignoring these files. If possible I'd like to set it globally so that I don't have to keep doing the same thing for every ASP.NET Web Application that I write and create a new repository for.

Answers

A list of files to ignore as submitted in the answers below,

  • bin
  • obj
  • *.exe
  • *.pdb
  • *.suo
  • _ReSharper.*
  • *.user

General concensus seems to be that these should be ignored on a per project basis at the creation of the repository. They will then be ignored by all users using the repository.

7
Note that the rules regarding what files shouldn't go in Subversion also apply to any other source control system.Richard Ev

7 Answers

7
votes

Not really 'definitive', but I always ignore .suo and .user files and the bin/ and obj/ directories

5
votes

Here's my ignore list from TortoiseSVN. VisualSVN requires TortoiseSVN and uses its settings.

bin obj *.exe *.pdb *.suo _ReSharper.* *.user

I haven't committed any unwanted (or not committed any wanted) files with this setting.

3
votes

If you have any WCF service references then you only need to include the files Reference.cs and Reference.svcmap for each service reference.

2
votes

The AnkhSVN plugin for Visual Studio has a list of files to ignore automatically and will only commits the files needed.

At least that's how I find it. It's taken me a few attempts at setting up the repository correctly but with AnkhSVN only commits a subset of he files that TortoiseSVn wants to commit. If ignores files recompiled on every Build for example.

1
votes

Depending on your situation, you might want to keep the Web.config out of revision control as well. Different developers might require different configuration files for a website.

I'd recommend setting up a separate directory in your repository with a reference configuration file for the website and ignoring *.config on the actual project directory.

1
votes

Additionally, to cover case sensitivity issues with "bin", I had to add [Bb]in to mine. So I have:

[Bb]in obj  *.exe *.pdb *.suo _ReSharper.* *.user

Also, this link explains how to handle project specific excludes as well so that others get the same exclusion behavior only for the same project when they check it out:

http://svnbook.red-bean.com/en/1.1/ch07s02.html

I used the svn:ignore property on a particular directory to exclude a certain set of files that were copied into there (but I still wanted the directory itself in svn).

0
votes

Use VisualSVN to do the initial "Add files to repository" and it automagically ignores the stuff you don't want-such as suo files and the bin/obj folders.