سؤال

Can I mark an entire namespace as obsolete in .NET Framework (3.5 and 4) somehow, or alternativly an entire project?

هل كانت مفيدة؟

المحلول

It is not possible. I guess reason is that namespace can span accross different assemblies and even users of the library can use same namespace, so it would obsolete not only your code. Namespace is basically a syntax sugar for name prefix. Namespace can not even be target of an attribute.

نصائح أخرى

Obsolete attribute can not be applied to namespaces. The ObsoleteAttribute is decorated with [AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Enum|AttributeTargets.Constructor|AttributeTargets.Method|AttributeTargets.Property|AttributeTargets.Field|AttributeTargets.Event|AttributeTargets.Interface|AttributeTargets.Delegate, Inherited = false)] .

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top