7

I wonder if there is a way to tell Web Deploy not to touch a certain folder during deployment while removing all the other additional files.

Basically I want to leave the "Remove additional files at destination" option on to remove some of the outdated files while preserving all the files within one folder on the server.

The folder contains unknown amount of files generated by the server and I do not want to have to make a copy of those during deployment and copy them back.

I tried using ExcludeFoldersFromDeployment option and it still removes all files in the folder

Steve
  • 11,696
  • 7
  • 43
  • 81
  • Did you ever find a way to accomplish this? – Dale K Oct 02 '19 at 22:09
  • 1
    @DaleBurrell unfortunately no – Steve Oct 03 '19 at 15:46
  • I posted a very similar question a couple of years ago. It’s framed regarding Azure Pipelines, but the answer should address the question here as well. Does this answer your question? [Azure Pipelines: Exclude folders using Azure App Service Deploy](https://stackoverflow.com/questions/60537030/azure-pipelines-exclude-folders-using-azure-app-service-deploy) – Jeremy Caney Jan 26 '23 at 07:41

2 Answers2

1

The following element excludes all files from the wwwroot\content folder:

<ItemGroup>
  <MsDeploySkipRules Include="CustomSkipFolder">
    <ObjectName>dirPath</ObjectName>
    <AbsolutePath>wwwroot\\content</AbsolutePath>
  </MsDeploySkipRules>
</ItemGroup>

https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/visual-studio-publish-profiles?view=aspnetcore-7.0#exclude-files

-2

Try this documentation, you might find it useful MS Document

Gerald Kenny
  • 7
  • 1
  • 4