Missing xml comment for publicly visible type or member web
missing xml comment for publicly visible type or member web api
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sandhiya PriyaRank #26 · 43.2K reputationPosted Jan 2, 2026, 6:22 AM EST
Web API:
The warning “Missing XML comment for publicly visible type or member” appears when XML documentation is enabled and a public class, method, or property has no XML comment.
This is a compiler warning, not an error.
Why this happens
In your project:
XML documentation file generation is turned ON
Public Web API controllers or methods lack
///commentsHow to fix it (recommended options)
Option 1: Add XML comments (Best practice)
Add comments above public members.
/// /// Gets the list of users. /// [HttpGet] public IHttpActionResult GetUsers() { return Ok(); }Option 2: Disable XML documentation (If not needed)
In Visual Studio:
Right-click project ? Properties
Build tab
Uncheck XML documentation file
OR edit
.csproj:Option 3: Suppress the warning (Clean build, no comments)
Add this to
.csproj:This suppresses the XML comment warning only.
When should you care?
Required for Swagger / OpenAPI descriptions
Important for public APIs
Useful for long-term maintenance
Summary
Warning occurs because public members lack XML comments
Best fix: Add
///commentsQuick fix: Suppress warning 1591
Optional: Disable XML documentation
This is common in Web API projects and safe to handle using any of the above methods.