missing xml comment for publicly visible type or member web
missing xml comment for publicly visible type or member web api
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sandhiya PriyaPosted Jan 2, 2026, 11:22 AM
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.
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.