I am using Visual Studio 2019 and trying to exclude wwwroot\js\src files from getting copied to IIS when publishing. Similar questions have been asked but those what I have referred to don't work because some of the project file syntax shown in those examples are not valid. Even the Microsoft documented method is not working.
MS Official documentation - wpp.target files has no effect on publish. It still copies the wwwroot\js\src files.
This - In vs 2019; CopyToPublishDirectory is not a valid attribute to Content tag. However the valid syntax below:
<ItemGroup>
<Content Update="wwwroot\js\src\**">
<CopyToPublishDirectory>false</CopyToPublishDirectory>
</Content>
</ItemGroup>
still publishes the js\src folder to IIS.
This - doesn't help either.
This must be quite a simple task and yet not straight forward way to get it done. Any help is appreciated.