You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many "legacy" collection types in the .NET framework do not have the ObsoleteAttribute applied to them. To assist users who want to receive warning messages when these types are used, it would be helpful to have a diagnostic available.
This diagnostic would provide a solution for all parties discussing the matter in dotnet/corefx#384.
The text was updated successfully, but these errors were encountered:
What are you looking for with this diagnostic? Specific types or a pattern?
From the top of my mind, I'd say that any type that implements IEnumerable, ICollection, IList and IDIctionary and doesn't implement their generic counterparts (IEnumerable<T>, ICollection<T>, IList<T> and IDictionary<TKey, TValue>).
I'm open to suggestions. Also this is fairly low impact for me personally, but someone else more directly affected may want to start an implementation.
Usually ObsoleteAttribute specifies a recommended method or type. For example System.Uri.MakeRelative: [ObsoleteAttribute("The method has been deprecated. Please use MakeRelativeUri(Uri uri). http://go.microsoft.com/fwlink/?linkid=14202")]
I considered an analyzer whose fix is to update the obsolete method based on the message.
Figured such fix may fit this discussion.
However, the recommended method is just a string intertwined with the rest of the message, and sometimes the conversion would result in erroneous code due to incompatible types, like in PerformanceCounterCategory.Create.
What are you thoughts on extracting a fully qualified name from the message, or introducing a more systematic way to write the ObsoleteAttribute message?
Many "legacy" collection types in the .NET framework do not have the
ObsoleteAttribute
applied to them. To assist users who want to receive warning messages when these types are used, it would be helpful to have a diagnostic available.This diagnostic would provide a solution for all parties discussing the matter in dotnet/corefx#384.
The text was updated successfully, but these errors were encountered: