Unfortunately, the voted answer did not work for me. I had an ASP.NET Core web project and I used Web Deploy on a remote server. I tried to exclude the whole folder under wwwroot from being included in the deployment, and after various tests and different combinations of things, the only thing that worked for me was a combination of both:
- Exclude folder from project (i.e. right-click> Exclude from project)
AND
- Adding the following to my .csproj is exactly as it is, but changing
wwwroot\\profiles
to the directory you want to exclude. You should also repeat the entire fragment for each folder that you want to exclude:
<ItemGroup> <MsDeploySkipRules Include="CustomSkipFolder"> <ObjectName>dirPath</ObjectName> <AbsolutePath>wwwroot\\profiles</AbsolutePath> </MsDeploySkipRules> </ItemGroup>
frezq source share