Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent VS 2008 from publishing .svn folders as part of publish process?

When publishing an asp.net web site in Visual Studio 2008, is there a way that I can force it to ignore the .svn folders in my local working copy so that my target folder does not end up with .svn files as part of the output.

Thanks,

Jason

like image 359
Jason Sherrill Avatar asked Feb 04 '09 15:02

Jason Sherrill


2 Answers

Visual Studio has a problem with ".svn" folders inside web sites. Therefore, you should apply the subversion ASP.NET hack, which uses "_svn" directories instead of ".svn".

When using TortoiseSVN, this is simply an option in the TSVN settings (see the General page). When using the SVN command line client, then you have to set an environment variable (see this page for details).

After applying this workaround/hack, the publish website operation will work as expected (the _svn folders are ignored).

UPDATE:

The problems mentioned above, existed with Visual Studio 2003 (resp. the front page extensions it used). Newer versions of Visual Studio should not have the problem.

So the key seems to be to simply set the hidden flag on the subversion folders (_svn or .svn). Then the folders are ignored when publishing the website. (I'm using TortoiseSVN, and I guess it automatically sets the hidden flag on the subversion folders).

like image 140
M4N Avatar answered Nov 08 '22 23:11

M4N


The bin folder shouldn't be part of your source control, simply right click the Bin folder in the solution explorer and 'exclude from project'.

now use windows explorer, find your bin folder and delete the .svn folder(s).

next time you publish (after deleting everything) you won't have the .svn files there, also, each time you build your solution, it won't look like you need to check in changes.

like image 21
adudley Avatar answered Nov 08 '22 23:11

adudley