我有一个基本的服务主机:

m_host = new ServiceHost(m_service, m_baseAddress);
ServiceMetadataBehavior behavior = new ServiceMetadataBehavior();
behavior.HttpGetEnabled = true;
behavior.MetadataExporter.PolicyVersion = PolicyVersion.Policy15;
m_host.Description.Behaviors.Add(behavior);
m_host.AddServiceEndpoint(
    typeof(IManagerService),
    new BasicHttpBinding(), m_soapAddress);
m_host.Open();

我的问题是我如何知道要使用哪个PolicyVersion? MSDN并不是很有帮助,似乎认为我应该已经知道我想要1.2还是1.5 ...

PolicyVersion.Policy15 Property

PolicyVersion.Policy12 Property

最佳答案

如果其他人想知道从1.2到1.5有什么变化,可以使用here's a link给出更改列表。

从Denise那里,MSDN上有一篇文章,内容涉及如何使用代码来发布自己的元数据,该代码可以帮助运行该代码,您可以找到here

关于c# - Policy15和Policy12有什么区别?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/16899770/

10-17 01:42