DEV Community

Alexandru Bucur
Alexandru Bucur

Posted on

How to disable notifications in ASP.NET Core 2.0 for 'Missing XML comment for publicly visible type or member'

I've started playing with ASP.NET since I wanted for a long time to start learning C# but never had the time. Now with Core 2.0 it struck closer to home.

Unfortunately, the biggest issue right now is that the documentation is sparse.
Going trough the swagger tutorial requires to enable xml generation of the documentation in order to properly update the swagger definitions.

Once that's done you'll be met with a nice warning Missing XML comment for publicly visible type or member that unfortunately is a pita to work with when developing in Visual Studio Code since it constantly nags you when starting the debugger. Make note of the reported error code CS1591.

Now that we're having .csproj files again, the fix is rather simple.
You just need to include <noWarn>1591</noWarn> (without CS) under the DocumentationFile definition.

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <DocumentationFile>bin\Debug\netcoreapp2.0\Craidd.xml</DocumentationFile>
    <noWarn>1591</noWarn>
</PropertyGroup>
Enter fullscreen mode Exit fullscreen mode

Discussion (1)

Collapse
trumhemcut profile image
Phi Huynh

oh great, it works for my case as well. quite annoying :)