Friday, March 13, 2009

Shoutout - Using SVN for your C# .NET project

If you want to use Subversion(SVN) as source control for a C# .NET project, there are two issues you'll run into: the generated ".svn" subdirectories (which are incompatible with ASP.NET projects), and the various C# binary build artifacts that you'd want to keep out of a repository.

For issue one, SVN now supports an environment variable called SVN_ASP_DOT_NET_HACK. Setting this to any non-null value will make your SVN client use "_svn" subdirectories instead of ".svn" ones. Note that you won't be able to use any source trees you checked out before setting the variable, so you should commit all changes, blow away your current source trees, set the variable, and then check out the trees again. The description of this in the official SVN documentation is here.

For issue two, see this post. The author of this guide explains how to set your SVN project to ignore VS project binaries and directories (the /bin/* directories, .suo files, etc.) It would have been a perfect shoutout if they'd linked to the "_svn" hack instead of just mentioning it.

There are lots of reasons to use SVN instead of Visual SourceSafe, so I won't bother listing them.

Citation: SVN Documentation
Citation: Slashdotdash