2

I'm implemented ICompileModule, which allow using generic attributes. It works fine (Build successful), but Visual Studio mark this code as error (at analysis step).

Error 1

Error 2

Error 3

How i can hide/suppress these errors? May be using Visual Stuido/ReSharper plugin?

maxswitcher
  • 1,717
  • 2
  • 12
  • 14
  • 3
    Do you understand the message *"A generic type cannot derive from 'Attribute' because it is an attribute class"*? What makes you think such an error can be suppressed? – Frédéric Hamidi Jan 14 '16 at 10:02
  • Possible duplicate of [Why does C# forbid generic attribute types?](http://stackoverflow.com/questions/294216/why-does-c-sharp-forbid-generic-attribute-types) – NikolaiDante Jan 14 '16 at 10:06
  • @FrédéricHamidi, i understand the message and i'm implemented module, which allow using generic attributes (`========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========`) – maxswitcher Jan 14 '16 at 10:07
  • Possible duplicate of [C#: Any way to suppress compiler errors similar to suppressing warning messages?](http://stackoverflow.com/questions/4998321/c-any-way-to-suppress-compiler-errors-similar-to-suppressing-warning-messages) – Jeroen Vannevel Jan 14 '16 at 13:24
  • @JeroenVannevel, i do not want suppress compiler error, because at compilation step all fine. I need suppress/hide analysis error. – maxswitcher Jan 14 '16 at 14:51

1 Answers1

1

This is not the answer to this particular question, but it may help others who came here via the question's title.

Some errors are created by Roslyn Analyzers that can be toggled:

Right-click on project's References > Analyzers , "Open Active Rule Set" first step

Then toggle the error in question

second step

Unfortunately for @maxswitcher, the error in question is not handled by Roslyn Analyzers.

Amadeusz Wieczorek
  • 3,139
  • 2
  • 28
  • 32