Open ZacP opened 9 years ago
No that's not supported. You can exclude files in the publish profile (.pubxml) but you'll need to author that in MSBuild.
It may be possible you edit the .pubxml to do what you want. Related code at https://github.com/ligershark/publish-ignore/blob/master/src/ls.pubignore.wpp.targets#L19
Thanks Sayed.
Is there any way to read the publish profile name in the .wpp.targets file? If so, this would be really easy.
For example, if we could get the profile name as $(ProfileName)
<PubIgnoreFiles Include="$(MSBuildProjectDirectory)\publish-$(ProfileName).ignore" Condition=" Exists('$(MSBuildProjectDirectory)\publish-$(ProfileName).ignore') "/>
Try PublishProfile, if that doesn't work respond here and I'll look into it. I'm not 100% sure if VS sets that or not, but for cmd line publish that is the property.
Nope - that property doesn't work. We tried that and a few other variations but it didn't work.
I just tried PublishProfile again to double check but it doesn't work.
Thanks for your help
Ok I will investigate and reply.
Is it possible to execute different publish ignore files based on the name of the publish profile?
For example, if we have two publish profiles - one for PublishA and one for PublishB, can we run publishA.ignore and publishB.ignore for these profiles?