Excluding folder contents from publish
See original GitHub issuePublishing from Visual studio to IIS server on Windows Server 2012 R2
In .csproj:
<ItemGroup>
<Content Include="wwwroot\LicenceFiles" CopyToPublishDirectory="Never" />
</ItemGroup>
Expected behavior
For the contents of this directory not to be published
Actual behavior
The directory contents are being added to the server when publishing
Is there another way in core to stop folders from being published? Specifically, this is a folder that I am writing generated PDF files to. Obviously I don’t want to be pushing up any of the files that have been generated in development, so want to retain the folder on the server but just not sync any content.
Issue Analytics
- State:
- Created 7 years ago
- Comments:20 (10 by maintainers)
Top Results From Across the Web
MS Visual Studio: How to exclude certain Project Folders ...
I have certain folders which I want to keep in the project but not to include it in publishing. Is that possible? ......
Read more >Excluding Files and Folders from Deployment
In the Solution Explorer window, right-click the file, and then click Properties. · In the Properties window, in the Build Action row, select ......
Read more >dotnet/sdk - Excluding folder contents from publish #7861
Is there another way in core to stop folders from being published? Specifically, this is a folder that I am writing generated PDF...
Read more >Excluding Files and Folders in Visual Studio Web Site Project
Publish profiles now seem to be located under Project Properties (the little wrench icon, not the Properties page). Took 4-eva to find em,...
Read more >Exclude folder from publish to Orchestrator - Help
Exclude folder from publish to Orchestrator ... Hi,. Is there a way to exclude certain files/folders from being part of the Publish feature?...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ralphking I just tried this on VS 2017 RTW and seems to be working. It is excluding all the files (including sub directories) from wwwroot\images
If you are publishing from VS, please make sure to check this so that if the files are already present, they will be removed as well.
Please use
The Web SDK (assuming that’s what you are using) is including these files for you already. So you need to update the files’ metadata to prevent them from being published.