During importing a service endpoint (VS and svcutil.exe) custom policies can be handled by policy importers ( http://msdn.microsoft.com/en-us/library/ms730284(v=vs.110).aspx ).
However, this only works for policies included in the same WSDL document and identified via the wsu:ID attribute.
Policies residing in secondary WSDL documents (imported using a wsdl:import element) are not resolved properly.
If the policy is identified using a name attribute, svcutil.exe will issue a warning:
Warning: Unreachable policy detected.
A WS-Policy element embedded in WSDL is missing a fragment identifier. This policy cannot be referenced by any WS-PolicyAttachment mechanisms.
Even if the policy comes with an wsu:Id attribute, it will not be found, as policies are obviously only searched in the WSDL document with the wsp:PolicyReference element. (While the name-issue might be neglect, this seems to be an actual bug!)
Note: the policy is embedded in a secondary WSDL containing a wsp:Policy element - not a distinct policy file.
Support of referencing policies in external files and by name is part of the WS-Policy standard:
This is necessary for interoperability, e.g. with Java, Metro:
Example 19.1. (same document, using wsu:Id) is supported by WCF, example 19.3 ff is not.
Note that other Java implementations don't have the option to choose how to reference a policy!