Is it possible to mark system classes or methods as deprecated in C #?

Can I apply the Deprecated Attribute to system classes or methods? If so, how? If not, can I instruct Visual Studio to warn specific code templates?

In particular, I would like to note the use of Session / Session ["key"] as deprecated in favor of a possible singlet.

+3
source share
1 answer

It is not possible to mark types defined in other assemblies as obselete. ObsoleteAttributecan only be applied to the types of source code you are compiling.

Visual Studio, , . , , , FxCop, .

+4

All Articles