c# - ASP.Net web API Help Page - no content -
i installed package nuget, uncommented line helppageconfig.cs-
config.setdocumentationprovider(new xmldocumentationprovider(httpcontext.current.server.mappath("~/app_data/xmldocument.xml")));
i've set same file under properties->build->xml documentation file, added new global.asax.cs file in call registration areas under application_start method:
protected void application_start(object sender, eventargs e) { arearegistration.registerallareas(); }
i've added summary of controllers:
public class incidentscontroller : apicontroller { /// <summary> /// summary /// </summary> /// <param name="incidentid">this incidentid</param> /// <returns>it returns something</returns> [route("{incidentid}")] [httpget] public object getincidentbyid(int incidentid) { return incidents.singleordefault(i => i.id == incidentid); } }
when run webpage , go '/help' thing see is
asp.net web api page
introduction
provide general description of apis here.
and empty page after that...
i tried debug , in helpcontroller.cs in:
public actionresult index() { viewbag.documentationprovider = configuration.services.getdocumentationprovider(); return view(configuration.services.getapiexplorer().apidescriptions); }
i no apidescriptions.
what missing? i'll appreciate help!
i able solve adding globalconfiguration.configure (webapiconfig.register);
in application_start ()
method. because application uses owin registering apis in startup.configuration (iappbuilder app)
.
Comments
Post a Comment