asp.net-web-api - WebAPI APIExplorer 文档没有收到我的摘要评论

标签 asp.net-web-api asp.net-mvc-apiexplorer

使用 http://www.asp.net/web-api/overview/creating-web-apis/creating-api-help-pages文档指南并将这些应用于每个公共(public) API Controller

/// <summary>
///  My own description comments
/// </summary>

但不知何故,我的摘要评论都没有被 XML 生成器 ApiExplorer 拾取。

有什么想法吗??

最佳答案

在解决方案资源管理器中,右键单击项目并转到“属性”。在“构建”选项卡中,选中“XML 文档文件”复选框。

然后将生成的 XML 文件从 bin 文件夹复制到项目中,通常是“App_Data”文件夹。引用 HelpPageConfig.cs 中的文件帮助页面 MVC 区域的。将有一个看起来像 config.SetDocumentationProvider(new XmlDocumentationProvider( HttpContext.Current.Server.MapPath("~/App_Data/Doc.xml"))); 的注释行。更改 XML 文件名并取消注释该行。

关于asp.net-web-api - WebAPI APIExplorer 文档没有收到我的摘要评论,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19393997/

相关文章:

c# - 使用 MVC WebApi 2 在运行时更改数据库

asp.net-mvc - 同时运行Web API和MVC项目

c# - WebAPI 帮助页面 - 返回或参数模型/类属性的文档

asp.net-core - 在 ASPNET Core 中的路由中使用 ApiExplorerSettings GroupName

c# - 如何使用 OWIN 中间件在 Web Api 中实现 OAuth2 Authorization_Code Flow?

iis - SystemWeb Host : IAppBuilder. UseWebApi 忽略带有扩展名的路径

c# - 如何从 silverlight 应用程序调用 Web api

asp.net-web-api - Web Api - 使用 ApiExplorer 自动生成请求示例

c# - ASP.Net Web Api - ApiExplorer 不包含任何 ApiDescriptions