Thursday, June 18, 2015

Excluding folders upon publishing the website

In VS2013, after you have setup the "publish" (right click on the website and choose Publish Web Site), a new configuration file (website.publishproj) will be added to the project.

To exclude the folders, you have to open this file and add the following section with the "project" section:

  <ItemGroup>
    <ExcludeFromPackageFolders Include="log;temp;">
      <FromTarget>Remove temp folders</FromTarget>
    </ExcludeFromPackageFolders>
  </ItemGroup>

In the "Include" attribute, it contains the folder to be removed when publishing the website. The above example excluding "log" and "temp" folders.


No comments:

Post a Comment