Is there any way to mark types that I don't control as deprecated in any way? Basically I would like to add ObsoleteAttribute to the types that I don't want to use in my .net project (i.e. SerializableAttribute)
I believe I can do something similar with FxCop, but ideally I would like the compiler to already generate warnings for greylisted Types?
It should be at the Per-Project level, but, unfortunately, “Extension Attributes” do not exist, and adding them to Runtime is too late for ObsoleteAttribute ...
Change: . To clarify, I do not want to block usage types (remember that ObsoleteAttribute generates a warning by default, not an error!), I just want to generate warnings when they are used, as in 99% of cases, it is incorrect to use them (i.e. SerializableAttribute) . In addition, I mean not only .net types, but also some types of third-party manufacturers. This is more a reminder. I guess FxCop is the best choice.
source
share