Why is the obsolete cause of the error?

I use:

[Obsolete("Use AnotherMethod() insted.", false)] 

The second parameter is false , but Visual Studio shows a warning as an error for each legacy method that prohibits the compilation project. How to make VS mark these calls as "Warning is not an error"?

+6
source share
1 answer

In the deprecated method, define:

 #pragma warning disable 0618 [Obsolete("test",false)] private void myMethod() 

then go to the project properties, in the build process, in suppressing the type of warning type 0618. Now it will ignore that specific method and the project will compile

+5
source

Source: https://habr.com/ru/post/914501/


All Articles