我已將.net webapi幫助頁面nuget項目添加到我們的webapi以生成幫助文檔。WebApi幫助頁面不從XML文件中讀取
我在命令行中添加如下:
安裝,包裝Microsoft.AspNet.WebApi.HelpPage
其安裝最新的版本。我那麼的WebAPI項目輸出的輸出設置爲
的App_Data/XmlDocument.xml
這是此處的例子;
並且這產生細。
然後我沒有評論該行;
config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/App_Data/XmlDocument.xml")));
再次按照鏈接。
但是,當我運行我的api並導航到webapi/help url。返回的模型爲空? (也沒有錯誤出現)。
然後我顯示佈局的標題,但沒有api文檔?
要添加的一件事是我在這個api中使用OAuth。 (雖然它的解決途徑,從而可以這樣造成的任何問題?)作爲參考,這是我的startup.cs
public void Configuration(IAppBuilder app)
{
HttpConfiguration config = new HttpConfiguration();
LoggingConfig.RegisterLogger();
config.DependencyResolver = new UnityDependencyResolver(
UnityConfig.GetConfiguredContainer());
ConfigureOAuth(app);
WebApiConfig.Register(config);
app.UseCors(CorsOptions.AllowAll);
app.UseWebApi(config);
AreaRegistration.RegisterAllAreas();
}