views:

1040

answers:

3

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

A: 

You can right click on the folder in VS and remove it from the project, or you can make sure any of the files contained in the folder have their Build Action set to None and Copy to Output Directory set to Do not copy

Mike_G
The .svn folders don't actually show up in solution explorer (see screenshot here http://screencast.com/t/WR1tmU1WyR3)
Jason Sherrill
This would also be highly impractical for large projects
Nik Reiman
+3  A: 

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

M4N
Martin, thanks for the reply. Setting to hidden helped with all but the .svn folder inside /bin. It still publishes the .svn folder in there, even though the folder is hidden. Here is a screenshot showing my local working copy /bin and target /bin.Any ideas on this peculiarity?
Jason Sherrill
Ooops, here is the screenshot: http://screencast.com/t/CJ0mU2SlI
Jason Sherrill
I'm sorry, but I have no idea why this happens. I'm also using SVN with web site projects and have never had this problem (one difference is that I'm using "_svn" instead of ".svn"). Are you using "web site" or "web application" projects?
M4N
A: 

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.

adudley