This warning cs1591 missing xml comment for publicly visible type or member, you may get while building the application or Visual studio will also display red squiggle in your code at all places where XML comments are missing. The warning can be ignored, but that red squiggle in code is quite annoying. So in this short post, find out how to fix/disable this warning cs1591 in ASP.NET Core projects.
Fix in ASP.NET Core
Adding XML comments to the publicly visible types and members is a great but it’s time consuming. You have to add it to every single file. But with ASP.NET Core, this warning can be disabled easily. Open up your Project.JSON, and look for
buildOptions section. You may find following line added,
So either you remove this line or set it to false. By default, the value of
xmlDoc option is false. So it’s safe to remove. Save your project.json and now build your application. The warning cs1591 missing xml comment for publicly visible type or member is gone.
This will work for you now, but the bad news is Project.json for ASP.NET Core is going away. So in future you will get this warning again. So the permanent fix would be.
- Right-click the Visual Studio project / Properties / Build Tab
- Insert warning number 1591 in the “Suppress warnings” section. And save the project file.
That should also fix/disable this warning. One more interesting thing to notice here is that, if you open project.json and you will find following line added in
"nowarn": [ "1591" ]
nowarn settings is used to keep a list of warnings to ignore.
Hope this helps!!!!!
Thank you for reading. Keep visiting this blog and share this in your network. Please put your thoughts and feedback in the comments section.
If you want to learn ASP.NET Core, I want to personally recommend Programming ASP.NET Core as the best resource out there.