使用控制器上的XML注释的ASP.NET Web API帮助页面文档 [英] ASP.NET Web API Help Page documentation using Xml comments on controllers
问题描述
我安装了的ASP.NET Web API帮助页面包,并想用它来生成使用XML注释已经对他们我的API控制器动作文档。
I installed the ASP.NET Web API Help Page package and would like to use it to generate documentation for my API controller actions using the Xml comments already on them.
我读到一篇<少时href=\"http://blogs.msdn.com/b/yaohuang1/archive/2012/09/30/asp-net-web-api-help-page-part-1-basic-help-page-customizations.aspx\">article在姚明的MSDN博客,在那里他将讨论如何文档可以基于XML注释生成。
I came across an article on Yao's MSDN blog where he discusses how the documentation can be generated based on the XML comments.
然而,在 HelpPageConfig
的注册方法,在 SetDocumentationProvider
方法期望 XmlDocumentationProvider
构建了一个XML文档文件的物理路径。
However, in the Register method of HelpPageConfig
, the SetDocumentationProvider
method expects an instance of XmlDocumentationProvider
constructed with a physical path to an Xml documentation file.
有另一种方式来做到这一点?我不明白为什么我需要指向一个XML文档文件。
Is there another way to do this? I'm not clear why I need to point to an Xml documentation file.
感谢
推荐答案
该XmlDocumentationProvider正在寻找的XML文件(有你的XML code注释)。
您可以启用转到您的项目属性生成此 - >构建 - >输出。这里选择XML文档文件复选框。
The XmlDocumentationProvider is looking for the xml file(having your xml code comments) which gets generated when you compile your project. You can enable generating this by going to your project Properties -> Build -> Output. Here select the checkbox for XML Documentation file.
这篇关于使用控制器上的XML注释的ASP.NET Web API帮助页面文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!