TypeName | SA1135UsingDirectivesMustBeQualified |
CheckId | SA1135 |
Category | Readability Rules |
📝 This rule is new for StyleCop Analyzers, and was not present in StyleCop Classic.
A using directive is not qualified.
A violation of this rule occurs when a using directive is contained within a namespace and is not qualified. Note that alias definitions of classes within the same namespace do not need to be qualified.
For example, the following code would produce a violation of this rule:
namespace System.Threading
{
using IO;
using Tasks;
}
The following code would not produce any violations:
namespace System.Threading
{
using System.IO;
using System.Threading.Tasks;
using T = Thread;
}
To fix a violation of this rule, use the full qualified namespace name.
namespace N1.N2
{
#pragma warning disable SA1135 // Using directives must be qualified
using N3;
#pragma warning restore SA1135 // Using directives must be qualified
}