• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1374
  • Last Modified:

How do I recursively exclude folders using MSBuild?

I am new to MSBuild and am having some trouble figuring out how to recursively exclude folders of a certain name.  

I know how to just exclude a certain directory like this

<ExcludeFromBuild Include="$(SourceWebPhysicalPath)\someFolder" />

it is also no problem to recursively exclude certain file types like so

<ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\*.csproj" />

The problem I am running into is when dealing with subversion directories.  In a bunch of the folders on the development site there are .svn folders, which are needed for using subversion.  What I am trying to do is when I build the site, exclude all folders in the site that are named .svn .  I am having some issues getting this to work, so I am hoping someone can point me in the right direction.  I tried

<ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\.svn" />

but that did not do the trick.

1 Solution
Try it with one more asterisk.
<ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\.svn" />

Should be:
<ExcludeFromBuild Include="$(SourceWebPhysicalPath)\**\*.svn" />
velirAuthor Commented:
Yeah I actually tried that as well and it did not work.  I have actually started doing this a different way where I do not need to exclude those directories any more.  \

Thanks for the help though!


Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now