Leomar de Souza
Leomar de Souza

Reputation: 757

Folder being published even after setting to not copy

I am having a problem with deleting folders at the time of publishing my project via FTP to the server. Even using the code below, the upload folder is still sent and the solutions I found on the internet did not solve.

<ItemGroup>
    <Content Update="wwwroot\upload">
      <CopyToPublishDirectory>Never</CopyToPublishDirectory>
    </Content>
</ItemGroup>

My FTP publishing configuration: enter image description here

Publishing log:

enter image description here

Upvotes: 0

Views: 41

Answers (1)

Bruce Adams
Bruce Adams

Reputation: 12310

Add **\*.* if you want to exclude everything under that folder:

 <ItemGroup>
    <Content Update="wwwroot\upload\**\*.*" CopyToPublishDirectory="Never" />
  </ItemGroup>

https://github.com/dotnet/sdk/issues/7861

Upvotes: 1

Related Questions