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 Items To Deploy
field to All files in this project folder
as you can see below:
Then I began looking for a way to exclude folders from All files in this project folder
. I found this page, which specifically states
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.
This page links to another that explains how to edit the file, but doesn't explain how to exclude specific folders.
I found other sites (this one included) that explained how to exclude folders in older versions of Visual Studio using the following tag in the csproj file:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
...
<ExcludeFilesFromDeployment>File1.aspx;File2.aspx</ExcludeFilesFromDeployment>
<ExcludeFoldersFromDeployment>Folder1;Folder2</ExcludeFoldersFromDeployment>
</PropertyGroup>
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 [PublishProfileName].pubxml
file, but trying this failed to work.
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.