How to suppress warning, in Rider?

Answered

I want to suppress the infamous warning:

> [CS1591] Missing XML comment for publicly visible type or member ...

Inspired by Visual Studio, I went to project > Properties and found the **Suppress warning** section. However, it is read-only.See also screenshot below. How/where can I edit these values in a netcore 2.0 app?

---

Rider 2017.2
Build #RD-172.4144.1459, built on October 12, 2017
JRE: 1.8.0_152-release-915-b11 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.13

0
6 comments

Hi! Currently, the only way to acheive this is to add the following lines to .csproj file:

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
     <NoWarn>1701;1702;1705;1591</NoWarn>
</PropertyGroup>

We will make this property editable in the future versions, please watch this issue for updates.

1

Per the issue link above and tested to confirm, this is outdated.  You can now edit this in the project properties dialog and the csproj will be edited for you.  Go right click on project > properties > Configurations Menu Item > (select config) submenu item > Warnings And Errors section, and enter the error code in the Suppress warnings field.   

High five Rider peoples! 

0

This does not work. It should work, but it doesn't. Verified with Rider 2020.3

1

Hi Martin,

I could not reproduce this issue using Rider 2020.3.2. Could you check if the warning is suppressed for the relevant project configuration (e.g., if you are using the "Release" config, the warning should be suppressed in the properties of the "Release" configuration)?

If the configuration is correct, please open a new issue via Help->Report a Bug and attach a repro solution (if possible) or the .csproj of the affected project.

 

0

Ok, dug into this a little.

It turns out there is a .editorconfig file in the project. If I delete that file, all the XML-doc warnings disappears and the setting works. If I put it back, the warnings appear again. The file contains these entries (funnily enough). But they are underlined with "Unknown key" in Rider.

It's the *presence* of that file which overrides the Warning-setting somehow. It doesn't matter if the file is empty or not.

 

 

0

Rider overrides project settings to ensure that this behavior is similar to VS, which overrides suppressed warnings. The inspection will be updated when .editorconfig is saved - Rider will pick up the file changes and update the inspections accordingly.

You might want to save .editorconfig manually (CTRL+S) or close this file in the editor (to trigger autosave) if you want Rider to update this inspection immediately.

The "Unknown Key" in .editorconfig is a known issue. We would appreciate it if you could upvote it.

0

Please sign in to leave a comment.