title: Why does ExcludeFromPackageFolders not work for msbuild?
body: <p>I've been trying to figure out how to exclude folders from being deployed as part of my web site.  This needs to happen whether it's deployed from within Visual Studio, or whether it's deployed as part of a msbuild task on TFS build server.</p>
  
  <p>Here's my .pubxml file.  It works within Visual Studio (i.e. <code>bin</code> and <code>build</code> folders are not published), but the ExcludeFromPackageFolders seems to be totally ignored when TFS server builds it.  What am I missing here?</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
    &lt;PropertyGroup&gt;
      &lt;WebPublishMethod&gt;FileSystem&lt;/WebPublishMethod&gt;
      &lt;LastUsedBuildConfiguration&gt;Debug&lt;/LastUsedBuildConfiguration&gt;
      &lt;LastUsedPlatform&gt;Any CPU&lt;/LastUsedPlatform&gt;
      &lt;SiteUrlToLaunchAfterPublish /&gt;
      &lt;LaunchSiteAfterPublish&gt;True&lt;/LaunchSiteAfterPublish&gt;
      &lt;publishUrl&gt;\\server\site\folder&lt;/publishUrl&gt;
      &lt;DeleteExistingFiles&gt;True&lt;/DeleteExistingFiles&gt;
    &lt;/PropertyGroup&gt;
  
    &lt;Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets" /&gt;
  
    &lt;ItemGroup&gt;
      &lt;ExcludeFromPackageFolders Include="bin"&gt;
        &lt;FromTarget&gt;Project&lt;/FromTarget&gt;
      &lt;/ExcludeFromPackageFolders&gt;
      &lt;ExcludeFromPackageFolders Include="build"&gt;
        &lt;FromTarget&gt;Project&lt;/FromTarget&gt;
      &lt;/ExcludeFromPackageFolders&gt;
    &lt;/ItemGroup&gt;
  
  
  &lt;/Project&gt;
  </code></pre>