I use:
[Obsolete("Use AnotherMethod() insted.", false)]
2nd parameter is false
but Visual Studio shows Warning as Error for every obsolete method call preventing project from compilation. How to make VS mark these calls as Warning not Error?
Obsolete attributes are used to display an error or warning during compilation with an optional message to alert the developer that the given type or its member should not be used in the code as it is going to be replaced.
In programming the term 'OBSOLETE' means that the assembly/resource/function/type its deprecated or old, translated it means that the compiler notices you that there is a better or newer way to do it.
On the obsolete method define:
#pragma warning disable 0618
[Obsolete("test",false)]
private void myMethod()
then go to project properties, under build, in suppress warning type type 0618, Now it will ignore that particular method and project will compile
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With