Asp.NET Web API: 未在引用项目中为 类 生成帮助说明

Asp.NET Web API : Help Description not generated for classes in referenced project

我可以设置 Web API 帮助,它会生成帮助页面。但是,没有记录响应和请求 class 类型,它们具有在不同项目中定义的类型的属性。

这是示例代码:

    /// <summary>
    /// Add New Product
    /// </summary>
    /// <param name="productRequest">The new Product Request to be added</param>
    /// <returns>Operation status and information of the new product request</returns>
    // POST api/InventorySystem/Products
    [Route("")]
    [HttpPost]
    public InsertProductResponse Post([FromBody]InsertProductRequest productRequest)
    {
        InsertProductResponse response = null;

        // Some code goes here
        response = new InsertProductResponse ();

        return response;
    }

帮助页面确实包含说明 "Add New Product"。但是,当向下钻取到 "InsertProductResponse" 对象时,没有描述。

InsertProductResponse 在单独的 class 库中定义,XML 文档为此 class 定义。但是在帮助页面上没有看到。

我认为 class 库生成的 XML 文档没有与 Web API 项目生成的 XML 文档合并(App_Data/XmlDocument.xml).我如何让它工作?

知道了 - 需要更改帮助区中的一些代码。参考这个 post

How can Xml Documentation for Web Api include documentation from beyond the main project?