XML Comments not appearing in WCF Service

眉间皱痕 提交于 2019-11-27 06:20:05

问题


I have a WCF service and commenting my operation contracts as below:

    /// <summary>
    /// Call to topup a card.
    /// </summary>
    /// <param name="topUp">The TopUp object which specifies the card to topup.</param>
    /// <returns>Returns a boolean indicating whether call has finished successfully.          </returns>
    [OperationContract]
    bool UploadTopUp(TopUp topUp);

However the XML comments I am putting in the 3 forward slashes as above /// do not appear in the tooltips in my client application that consumes it, is this standard WCF/web service functionality? Will they never appear? OR is there a way to make them appear?


回答1:


Xml Doc comments are generally not integrated into the generated WSDL for a WCF service. This information is usually only available when the appropriate xml documentation file is co-located with a directly referenced assembly.

The only information that is included in a generated WSDL (or metadata provided by a MEX endpoint) are the properties of the contract attributes themselves. Check the documentation for the following:

  • ServiceContract
  • OperationContract
  • DataContract
  • DataMember
  • MessageContract
  • MessageHeader
  • MessageBodyMember
  • FaultContract


来源:https://stackoverflow.com/questions/3239327/xml-comments-not-appearing-in-wcf-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!