Enable the Api Description in WebApi 2 (Description in Help) and webapide.pdf

Source: Internet
Author: User

Enable the Api Description in WebApi 2 (Description in Help) and webapide.pdf

Environment: vs2013 + web api 2

Problem: by default, the Web Api 2 project is created. The Api information is displayed on the Help page, but the Description Column cannot obtain data, as shown in:

Solution:

1. Enable the output XML document file:

Right-click a web api project and choose Properties. Under the "generate" tab on the property page, select the following "XML document file", as shown in:

2. In solution manager, type HelpPageConfig. cs, remove the SetDocumentationProvider method, and change the address to the corresponding one in 1, as shown in:

3. Add comments to the Api, as shown in:

Run the project again and open the Api Help page to see the effect, as shown in:

 

Reference: ASP. NET Web API Help Page documentation using Xml comments on controllers

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.