2

I want the clients consuming my WCF web-service to have comments on the services methods/parameters and other data contracts.

I mean, I want the XML comments which I put in the WCF server side, to appear as intellisense popups in the client application that consumes my web-service.

Which attributes can I use in the ServiceContract to achieve this?
I really want to be able to do this with out of the box solution.

I have seen a few very old "solutions", which will make this task a nightmare, and wondering if there are any 2019 build-in solution for WCF?

I'm on VS 2017, with 4.6.2 framework.

zig
  • 4,524
  • 1
  • 24
  • 68
  • If you are looking for a way to make documentation for `class` and it's `methods` then Did you try XML comments and documentation or `///`? – Aria Jan 23 '19 at 11:28
  • @PanagiotisKanavos, Yes I want the XML comments which I put in the WCF server side, to appear as intellisense popups in the client application. – zig Jan 23 '19 at 11:54
  • @zig Check [this similar question](https://stackoverflow.com/questions/3239327/xml-comments-not-appearing-in-wcf-service). Short of generating human-readable docs from those XML doc files, there's no real alternative. You can emit `document` or `annotation` elements into WSDL or XSD documents but those can't contain complex text. Even if you copy the xml doc files into your own project, the type names and namespaces won't match the proxy types. *Perhaps*, if you put the proxy in a separate project, copy the xml docs and modify their namespaces to match the project, Intellisense will read them – Panagiotis Kanavos Jan 23 '19 at 12:21
  • @zig xml doc files are meant to be processed by tools to generate eg help files and sites. [This article](https://visualstudiomagazine.com/articles/2017/02/21/vs-dotnet-code-documentation-tools-roundup.aspx) shows many documentation generators that work with XML docs. – Panagiotis Kanavos Jan 23 '19 at 12:23

1 Answers1

1

try this https://github.com/abelsilva/swaggerwcf this provid ability to share service description

  • 1
    WCF already provides a service description as a WSDL and XSDs. Swagger is trying to provide the same thing for REST APIs. Trying to generate a Swagger document from WCF means the descriptions are *already* there – Panagiotis Kanavos Jan 23 '19 at 11:23