14

In VS 2010 for ASP.NET MVC 3 project there is an option to add a "Deployable Dependencies" folder (_bin_deployableAssemblies) (click right button on web project), files contained in this directory will be copied to the /bin directory.

If you are using Subversion, this task will also try to copy .svn folder and its content, which will result in an error due to a collision with /bin 's own .svn folder.

Question: how do you exclude .svn folder from being copied to /bin?

THX-1138
  • 21,316
  • 26
  • 96
  • 160

1 Answers1

17

Following seems to do the trick:

  1. backup and open file Microsoft.WebApplication.targets (on my computer found in C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications)
  2. find target named _CopyBinDeployableAssemblies
  3. in that task find line:

.

<CreateItem 
    Include="$(MSBuildProjectDirectory)\_bin_deployableAssemblies\**\*.*"
    Condition="Exists('$(MSBuildProjectDirectory)\_bin_deployableAssemblies')">

and add Exclude attribute as follows:

<CreateItem 
    Include="$(MSBuildProjectDirectory)\_bin_deployableAssemblies\**\*.*"
    Condition="Exists('$(MSBuildProjectDirectory)\_bin_deployableAssemblies')"
    Exclude="$(MSBuildProjectDirectory)\_bin_deployableAssemblies\**\.svn\**\*">
THX-1138
  • 21,316
  • 26
  • 96
  • 160
  • 3
    Those .svn folders annoyed the heck out of me before we moved over to TFS... now I have a whole new set of things to be annoyed about =P – porusan Apr 21 '11 at 21:57
  • Unfortunately this doesn't work for subdirectories of `_bin_deployableAssemblies`, like for `_bin_deployableAssemblies\amd64` – Boris B. Feb 08 '12 at 11:53
  • To include also subdirectories `Exclude="$(MSBuildProjectDirectory)\_bin_deployableAssemblies\**\.svn\**\*.*"` seems to work – Boris B. Feb 08 '12 at 12:05