-
Notifications
You must be signed in to change notification settings - Fork 38
Help Pages and Strongly Typed Client API
Help Pages for ASP.NET Web API is based on the info of controllers provided by ApiExplorer.
In older versions of WebApiClientGen before v2.4.1, the doc comments generated depends on XmlDocumentationProvider which read the XML documentation of the Web API.
WebApiClientGen v2.4.1 reads the XML documentation of the Web API directly, thus you don't need to enable XmlDocumentationProvider for doc comments in client APIs generated. If you want both Help Pages and doc comments in client APIs, you need to make sure that in HelpPageConfig, you have such line:
config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("bin/YourWebApiAssemblyName.xml")));
And in project properties, set Output XML documentation file as "bin\YourWebApiAssemblyName.xml".
With the .NET Core build of WebApiClientGen, the doc comments in the generated codes are directly imported from the XML file of the .NET Core Web API assembly, since the .NET Core Web API does not come with XML documentation provider.
In Visual Studio 2019 with .NET Core 3.0+, the default XML documentation file is pointing to the same folder of the project file. In order to make this file automatically available alongside the binary files, you may see the properties of the XML file with:
- Build Action=Content
- Copy to Output Directory=Copy if newer