davidp04
davidp04

Reputation: 33

Self documenting asp.net api

I created an Asp.net api in VS2015. Inside the Areas>HelpPage>App_Start>HelpPageConfig.cs I uncommented line 37

config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/App_Data/XmlDocument.xml")));

There was no XmlDocument.xml in the App_Data folder for the project so I created one with the tags I'd seen in self documenting xml's in other apis

<?xml version="1.0" encoding="utf-8" ?>
<doc>
  <assembly>
    <name>NameOfApiHere</name>
  </assembly>
  <members>
  </members>
</doc>

but when building and/or running the application nothing is going into the xml. It's my understanding that when this is turned on the XML sel documents based on each ///summary for a given method with an intellisense alert for any public method that does not have a summary but I cna't find any code that would explicitly copy summary information to this xml as "member" tags inside of teh "members" tag nor is it happening. What step am I missing that I'm not seeing in the how to's on the internet for turning on self documentation in an APi?

Upvotes: 0

Views: 158

Answers (2)

David Bettis
David Bettis

Reputation: 74

Try deleting the XmlDocument.xml file that you added (I think this autogenerates) and specify the path to it in the project settings -> Build tab inside the Output section.

Upvotes: 0

ASpirin
ASpirin

Reputation: 3651

In project propeties repoint XML documentation destintion folder to your desired folder. I suppose it would be better to use app_data instead of App_code folder.

take a look into 1st and 2nd steps of this question answer

Upvotes: 1

Related Questions