ReSharper doesn't suppress a warning

465 views Asked by At

I'm using ReSharper and StyleCop to impose some naming conventions. I have a rule for a class name to start with an upper case. In some classes, however, I need to violate the rule (when naming classes that are direct map from my database I want them to have the names of tables, views and so on, and our convention is to start the name with lower case t_ for table, v_ for view).

I'm suppressing the warning using the [SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:ElementMustBeginWithUpperCaseLetter"] attribute. It works fine in one class. It doesn't in the other. Both classes are partial classes. In both cases I'm using the same attribute and the same message. But in one case I still can see ReSharper complaining.

This suppression works:

[SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:ElementMustBeginWithUpperCaseLetter", Justification = "Reviewed. The name of the class resembles the name of the table in the database.")]
public partial class v_All_w_Status
{
    // ..
}

And this doesn't:

[SuppressMessage("StyleCop.CShrp.NamingRules", "SA1300:ElementMustBeginWithUpperCaseLetter", Justification = "Reviewed. The name of the class resembles the name of the table in the database.")]
public partial class t_Programs
{
    // ..
}

I tried removing and adding suppressions again, but with no change in behaviour. Clearly, I'm missing something, but I cannot see what. Any help highly appreciated.

SOLVED:

In the second case there is a spelling error: it says CShrp instead of CSharp.

0

There are 0 answers