I have a .net core 2.1 class library for my models that I use in multiple asp.net core web api projects. I am using Swagger(version 3.0.0) for my API documentation. The Xml Comments are NOT displayed for the models in the class library. Yes, I have IncludeXmlComments in my Startup.cs. How do I get the Xml Comments working in my models class library?
NOTE: My models in my Projects directory are documented correctly by Swagger.
Here is where I include the Xml comments:
services.AddSwaggerGen(c => {
c.SwaggerDoc("v1", new Info { Title = "Web API", Version = "v1" });
c.IncludeXmlComments($@"{System.AppDomain.CurrentDomain.BaseDirectory}\ABC.Application.WebApi.xml");
});
IncludeXmlCommentsIncludeXmlCommentsbut you should have at least two one for your WebApi and the other for the class library that has your models.