So we are trying to deprecate some of our existing classes, and have started marking them as obsolete with the ObsoleteAttribute so they will stop being used. The fact that using the KnownType attribute with a type that is marked with the Obsolete attribute and is causing a compiler warning is expected. However, in our project we have warnings treated as errors so ignoring the warning isn't an option. Is there a compiler directive to suppress this warning?
The following usage causes a compiler warning:
///ProductTemplateDataSet is marked with the Obsolete attribute
[KnownType(typeof(ProductTemplateDataSet))]
public class EntityCollectionBase : System.Data.DataSet
{
}
Edit: I understand using compiler directives to ignore errors, but this compiler warning doesn't have a number.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…