views:

154

answers:

4

For some reason I need to check in a couple of files in the bin\Debug directory. For the past few weeks, I am noticing a strange behaviour from VS2005. Every time I recompile the code, it is deleting the .svn folder in the bin\Debug directory and hence svn is showing "obstructed" error. Even svn clean up doesn't help due to missing .svn folder. Is there any settings on VS2005 to prevent this? In the first place, why it is deleting .svn folder? This thread http://svn.haxx.se/tsvnusers/archive-2008-10/0019.shtml discuss about it but no useful solution to prevent this from happening. Any other suggestions?

+6  A: 

Why would you want to checkin some file to the bin directory? This is entirely wrong. Even if there are valid reasons. Yes I mean it.

Consider having another folder which might contain the necessary files that you want to write to bin. After building, have a post build script that copies these files into the bin folder

Xinxua
Thanks Xinxua. I fully understand and aware of your concern. It is one of the old project repository which was planned very badly and all the customer releases were kept in the bin folder itself instead of having a separate tag for the releases. All the new projects do not check in anything on the bin, obj folders and has separate tag for each releases.
M K Saravanan
+2  A: 

You dont. if VS cleans up the bin directory it deletes all content. This is to have a clean start - in case people put additional thigns in with a post build event script. Makes sense. /bin and /obj are VS managed temporary directories and not supposed to be under version control.

This is the one thing I also dont like about SVN - it is a lot more stupid than all other souce control integrations I ahve seen about ignoring the stuff Visual Studio does not want under source control in the first place.

TomTom
A: 

Why do you need to commit the code in the bin/Debug folder? Usually bin folder is marked as "ignored". I think you are doing someting wrong.

Andrew Bezzub
+4  A: 

Don't store files in the bin\Debug directory. Rather:

  • Store the files somewhere else (your solution directory, or a project directory)
  • Include the files in the solution or a project, and
  • Copy the files to the output directory during build by setting "Build Action" to "None" and "Copy to Output Directory" to "Copy if Newer" or "Copy Always"

Or:

  • Put the files in a separate folder, and
  • Copy them to the output directory through a post-build script
Håvard S
Yes, this is the best method to handle this scenario. If only it was a bit more obvious to Visual Studio users to handle it this way.
Bert Huijben