Disclaimer: I'm not asking how to Selectively suppress custom Obsolete warnings.
Background
I've got a property I wish to mark as obsolete.
This property is part of a solution that is wrapped in a NuGet and is used by many other solutions and branches, without proper semantic versioning.
Many of these other solutions and branches will not compile if there are any errors. So if I mark the property as obsolete, there will be a warning and numerous solutions and branches will consequentially fail.
I know the warnings can be suppressed with
#pragma warning disable 612, 618
int a = foo.GetObsoleteProperty;
#pragma warning restore 612, 618
...but it is impractical to edit each of the uses of GetObsoleteProperty
in each of these places.
Bottom line:
Is there a way to mark a property as Obsolete - but never generate a warning?
(Yes, I know this violates the general idea of marking a property as obsolete.)
Some alternatives I've considered which aren't exactly what I'm looking for:
- Using an XML comment
- Using
EditorBrowsableAttribute
, which doesn't work