C#C
C#4y ago
An.C

Suppress CS0618 for entire file [Answered]

Can I suppress CS0618 for an entire file? I tried with [System.Diagnostics.CodeAnalysis.SuppressMessage("Warning", "CS0618: Type or member is obsolete", Justification = "Some reason")] but it doesn't look correct. How can I achieve this?
I want to avoid to #pragma warning disable CS0618 // Type or member is obsolete on each single occurrence. And I want to avoid a global setting.
Was this page helpful?