If you use project.json , you can manage the files and folders that are included and excluded during the publishing process:
"publishOptions": { "include": [ "wwwroot", "appsettings.json", "appsettings.*.json", "web.config" ], "exclude": [ "wwwroot/less" ] }
For .csproj projects .csproj here is a good resource for replicating old project.json settings in XML, for example:
<ItemGroup> <Compile Include="..\Shared\*.cs" Exclude="..\Shared\Not\*.cs" /> <EmbeddedResource Include="..\Shared\*.resx" /> <Content Include="Views\**\*" PackagePath="%(Identity)" /> <None Include="some/path/in/project.txt" Pack="true" PackagePath="in/package.txt" /> <None Include="notes.txt" CopyToOutputDirectory="Always" /> <Content Include="files\**\*" CopyToPublishDirectory="PreserveNewest" /> <None Include="publishnotes.txt" CopyToPublishDirectory="Always" /> </ItemGroup>
Polynomial
source share