Alex Rivera | Logout

Enum.ToString() deprecated?

Asked 2010-10-04T22:07:52.313
12

When I type .ToString() on an Enum type in Visual Studio, the Intellisense shows a "strike-through" line through ToString() (although it builds and works fine). It seems to indicate that Enum.ToString() is deprecated in some way. Is this true? If so, why?

alt text

Edit
Report

1 Answer

27

The Enum.ToString overloads that take an IFormatProvider, ToString(IFormatProvider) and ToString(String, IFormatProvider), are both obsolete, because the IFormatProvider isn't used anyway.

The other overloads, ToString() and ToString(String), are not obsolete.

It's a feature of ReSharper to strike out obsolete class members. It's apparently not very good at it.

answered 2010-10-04T22:10:26.210

Your Answer