Why Rider does not highlight some warnings in C#?

95 Views Asked by At

I have the following example of CS0279 rule violation. In VS the waning is highlighted, but in Rider it is not. Some of CS* rules in Rider are highlighted and some are not.

public class myTest : IEnumerable
{
    IEnumerator IEnumerable.GetEnumerator()
    {
        yield return 0;
    }

    internal IEnumerator GetEnumerator()
    {
        yield return 0;
    }

    public static void Main()
    {
        foreach (int i in new myTest()) {}  // CS0279
    }
}

Rider warning

VS warning

I have tried to find something about Resharper in Rider settings but there was nothing.

1

There are 1 best solutions below

1
On

CS0279 is what Microsoft calls a level 2 compiler warning. Warnings like this are only displayed when actually compiling the code:
enter image description here

AFAIK it's not possible to display them without compiling, but as I'm curious too, I've contacted JetBrains and will keep you posted.