When the XmlPreprocess step runs on an MSI deploy, it actually ignores the LocationPath. You were very close in your original state.
Remove the CopyPolicyTemplate target again, and add this back in:
When you try the next deploy, check that ..\$(ProjectName).Config.Policy.xml is being created and that is has been preprocessed, and check that $(ProjectName).Config.Policy.xml has been copied into ..\BRE\Policies. It should then be picked up by the RulePolicies ItemGroup.
Sorry for the wrong turn. I'm going to delete my previous reply so it doesn't cause future confusion.
Thanks,
Tom
Remove the CopyPolicyTemplate target again, and add this back in:
<Target Name="CustomDeployTarget" Condition="'$(Configuration)' == 'Server'">
<Copy sourceFiles="..\$(ProjectName).Config.Policy.xml" DestinationFolder="..\BRE\Policies" />
</Target>
The only difference is to copy $(ProjectName).Config.Policy.xml not $(ProjectName).Config.Policy.Template.xml into your ..\BRE\Policies folder.When you try the next deploy, check that ..\$(ProjectName).Config.Policy.xml is being created and that is has been preprocessed, and check that $(ProjectName).Config.Policy.xml has been copied into ..\BRE\Policies. It should then be picked up by the RulePolicies ItemGroup.
Sorry for the wrong turn. I'm going to delete my previous reply so it doesn't cause future confusion.
Thanks,
Tom