views:

1001

answers:

8

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  A: 

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

AgileJon
Do you know how I'd go abut doing this in VisualSVN and whether I can do it as a global setting rather than per project?
Craig Bovis
Sorry, I use TortoiseSVN and I just end up ignoring them manually with each new project.
AgileJon
I add these files and directories to the svn:ignore list for each project. You only need to set those once per project, so you don't need to set them "globally". I prefer that way.
Nelson Reis
@Craig -- see my answer. You set this in TortoiseSVN. From the context menu of any folder: TortoiseSVN > Settings > Global Ignore Pattern.
Jamie Ide
+2  A: 

VisualSVN.com provides this information on configuring files to be ignored and the following question/answers provides examples of files to be ignored.

bryan_cook
+2  A: 

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.

David A Gibson
+5  A: 

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.

Jamie Ide
+1  A: 

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

Richard Ev
Also include app.config in your project directory.(Checking in the .wsdl file is not necessary, but you may want to do that as well, in case you ever want to refer back to an older version for a web service that was upgraded.)
Jeremy Frank
A: 

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.

Wyatt Barnett
+1  A: 

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.

Thorarin
+1  A: 

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).