Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ExcludeFoldersFromDeployment not working in publish profile

I am trying to exclude a folder in publish profile using ExcludeFoldersFromDeployment but it is not wxcluding while publishing to azure-app service

folder location : a\b\c\foldername

Please let me know if anyone can help!!

like image 801
neha Avatar asked Jan 05 '23 19:01

neha


1 Answers

Add an additional answer, in case someone got confused by different EXCLUDE methodologies, if you are working in this environment:

Visual Studio 2017 + ASP.NET core 2 + Azure App Service.

try this:

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

Edit YourProject.csproj file,

<ItemGroup>
  <Content Update="wwwroot/content/**/*.txt" CopyToPublishDirectory="Never" />
</ItemGroup>

BTW, I also tried these posts, which do not work:

  1. use .wpp.targets file: Excluding Files and Folders from Deployment
  2. Use Web Deploy Profile: Exclude unwanted binaries from azure package
  3. Use ExcludeFilesFromDeployment or ExcludeFoldersFromDeployment: Web Deployment: Excluding Files and Folders via the Web Application’s Project File

By all those methods, web.config could not be excluded, even following this post: How to exclude web.config when publishing with Visual Studio 2013?

like image 197
Dongdong Avatar answered Jan 08 '23 07:01

Dongdong