0

I have a folder in the web project's root folder which can be filled on the production web server with important user-specific files/folders which are not available in the project. (e.g. /Content/docs)

This folder can grow up to a few thousand files/folders, consequently when I publish a new version to the webserver, it can take a few minutes just to step over adding ACL's to that specific path.

According to this Microsoft Document I can exclude a folder from being published, but what if I would like to occasionally add/publish files to this folder?

How should I configure the wpp.targets XML to achieve this configuration ?

(p.s. I'm using VisualStudio's Web Deploy UI.)

pelican_george
  • 961
  • 2
  • 13
  • 33

2 Answers2

1

One way would be to create two publish profiles, one which includes the files, and one that doesn't.

As per this page, excluding the files would mean setting the "Items to deploy" dropdown to "Only files needed to run this application":

enter image description here

From the page:

  • Only files needed to run this application This will include only the files required to run the application. Specifically, files to be included will be those found in the bin folder and those files whose Build Action property = Content (such as .aspx, .ascx, and .master).

And for the other options:

  • All files in this project: This will include all files within the project file.

  • All files in this project folder: This will include all files in the source project folder, including those not listed in the project file and those marked as 'exclude'.

That page also shows how to do this on a granular level by using ExcludeFilesFromDeployment and /or ExcludeFoldersFromDeployment elements in the project file.

Community
  • 1
  • 1
stuartd
  • 70,509
  • 14
  • 132
  • 163
0

If you want to occasionally add/publish files to this folder with wpp.targets XML, the stuartd`s suggeation should be a feasible method. There is a simpler way to achieve your requirement. You can delete the wpp.targets file before publish when you want to add/publish files to this folder.

Note that: Pay attention to backup the wpp.targets file before delate it.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135