WCF服务参考不包括原始服务方法的注释
我使用一种方法创建了一个简单的 WCF Web 服务。这个方法有注释。
为什么注释没有出现在消费应用程序的服务参考中?
是否有其他方法可以将方法注释传播到代理?
/// <summary>
/// Do some work
/// </summary>
public void DoWork()
{
}
I have created a simple WCF web service with a method. This method has comments on it.
Why does the comment not appear in the service reference for a consuming app?
Is there some other way to propagate to method comments to the proxy?
/// <summary>
/// Do some work
/// </summary>
public void DoWork()
{
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
它不会出现在服务参考中,因为注释不是服务元数据的一部分。您可以使用两个选项来使注释显示在代理上:
It doesn't appear on the service reference because the comments aren't part of the service metadata. There are two options you can use to have the comments appear on the proxy:
也许 WCF Extras 适合您。听起来像是你想要的。
“从源代码 XML 注释添加 WSDL 文档”
Perhaps WCF Extras would work for you. It sounds like what you want.
"Adding WSDL Documentation from Source Code XML Comments"
确保您的服务参考标记为内部而不是公共,警告就会消失。
Make sure your service reference is marked as internal instead of public and the warning will go away.