title: How to exclude folders from publish/deployment of Visual Studio 2013 Web Application
body: <p>I'm publishing a Web Application from Visual Studio 2013. I need include folders that are not a part of the project, and exclude some folders (some apart of the project, some not apart of the project). So I went into my project's properties and set <code>Items To Deploy</code> field to <code>All files in this project folder</code> as you can see below:</p>
  
  <p><a href="https://i.stack.imgur.com/sHtVh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/sHtVh.png" alt="enter image description here"></a></p>
  
  <p>Then I began looking for a way to exclude folders from <code>All files in this project folder</code>. I found <a href="https://msdn.microsoft.com/en-us/library/dd394698(v=vs.110).aspx" rel="noreferrer">this</a> page, which specifically states</p>
  
  <blockquote>
    <p>The Visual Studio UI does not expose all of the deployment settings
    that you can configure. For example, you can't use the UI to exclude
    an individual folder from deployment. However, you can do this by
    editing the files that store configuration settings. For each publish
    profile there is a .pubxml file that you can edit directly.</p>
  </blockquote>
  
  <p>This page links to another that explains how to edit the file, but doesn't explain how to exclude specific folders.</p>
  
  <p>I found other sites (<a href="http://blogs.msdn.com/b/webdev/archive/2010/04/22/web-deployment-excluding-files-and-folders-via-the-web-application-s-project-file.aspx" rel="noreferrer">this one</a> included) that explained how to exclude folders in older versions of Visual Studio using the following tag in the csproj file:</p>
  
  <pre><code>&lt;PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "&gt; 
    ... 
    &lt;ExcludeFilesFromDeployment&gt;File1.aspx;File2.aspx&lt;/ExcludeFilesFromDeployment&gt; 
    &lt;ExcludeFoldersFromDeployment&gt;Folder1;Folder2&lt;/ExcludeFoldersFromDeployment&gt; 
  &lt;/PropertyGroup&gt;
  </code></pre>
  
  <p>But it appears the XML elements for the csproj file are no longer relevant in VS2013. I read somewhere (can't remember where now) a suggestion that this element had been moved to the <code>[PublishProfileName].pubxml</code> file, but trying this failed to work.</p>
  
  <p>I'm sure that there is a way to do this in Visual Studio 2013, but for the life of me, I can't figure out how. I've found dozen of related question here on Stackoverflow, as well as other forums, but none of the solutions work for me in VS2013. Any help is much appreciated.</p>