Obviously, you can do this using the wpp.targets file. Then skip only the desired folder ...
<ItemGroup> <MsDeploySkipRules Include="SkipErrorLogFolder1"> <SkipAction>Delete</SkipAction> <ObjectName>FolderPath</ObjectName> <AbsolutePath>ErrorLog</AbsolutePath> </MsDeploySkipRules> </ItemGroup>
Look here, look first:
MSbuild command-line option to skip a directory
source share