title: ASP.NET Web Application (MVC) Deployment Automation and Subversion
body: <p>We are trying to automate the build process to our staging servers but have run into a snag, albeit fairly minor.  We are using the Publish functionality built into VS2010, committing to Subversion, and then a 3rd party app (Beanstalk) automatically pulls the updated files and FTPs them to the Staging server.</p>
  
  <p>The problem we've run into is that we only appear to have the following choices:</p>
  
  <ul>
  <li>(Lesser of 2 evils) If we choose to use "Replace matching files with local copies", this works great, with one exception:  this option does not delete any files that were deleted from the project.  This will lead to junk and/or security issues for unkempt files from the days of old.</li>
  <li>If we choose to use "Delete all existing files prior to publish", this deletes the entire folder structure, including the .SVN hidden folders that Subversion uses for Update tracking, etc.  This seems like the best solution from an accuracy standpoint, but it really destroys the local SVN environment, which is the middle-man for this automation.</li>
  </ul>
  
  <p>My question:  Is there an easy work around for this, or a totally different deployment option we're overlooking (we do not want to publish directly to the server from VS, as we want to track who/what/when a deployment takes place)?  The only thing I've come across is to delete the file contents manually prior to publishing, while leaving the folder structure intact, then deploying with "Replace matching files with local copies".  Unfortunately, this brings on a whole new meaning of the word "automation".</p>
  
  <p>Any ideas on how best to accomplish this?</p>