There were before aspdotnet1.0
include/exclude sections on project.json
file
{
\"exclude\": [
\"node_modules\",
\"bower_c
In my case I need local.settings.json locally during debug, but I do not want it included in my WebDeploy zip file during Release builds or Publish:
<ItemGroup>
<Content Include="..\local.settings.json" Link="local.settings.json" Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\local.settings.json" Link="local.settings.json" Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Content>
</ItemGroup>
**
After Visual Studio 2017 15.3
Edit the .csproj file to manually exclude files/folder from being published
<ItemGroup>
<Content Remove="src\**" />
<Content Remove="node_modules\**" />
</ItemGroup>
ref: https://www.danielcrabtree.com/blog/273/fixing-the-duplicate-content-error-after-upgrading-visual-studio-2017
For Visual Studio 2019, I managed to exclued a wwwroot subfolder named "dummy" (including all subfolders of "dummy") from publish output using the following code:
<ItemGroup>
<Content Update="wwwroot\dummy\**\*">
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</Content>
</ItemGroup>
Note: The requirement was to keep the wwwroot and its subfolder(s) included in project but just exclude while publishing.