I was wondering if it were at all possible to change the warning level for invoking obsolete method/class in c# just like the way we can do it in c++. For example,
#pragma warning(2,some_warning)
can change some_warning's level to level 2 from whatever the warning level it by default has. It is at all possible to do stuff like that in c#?
Note: I have already considered the option of suppressing the warning using #pragma warning disable and restoring it after the api call. But my ask is, Is there a way to change the default warning level thrown by for example, ObsoleteAttribute?