Typically, the using directive is written outside of namespace (at the beginning of the file), but StyleCop generates the following warning:What does this mean?
SA1200:CSharp.Ordering: All using directives must be placed inside of the name space.
The SA1200 is subject to warnings for two reasons:
For more information, see the StyleCott SA1200 document.
If the alias is used in using as mentioned in the following Blog article and the alias is used without a namespace, the problem is that if the alias is outside the namespace, the compilation error will not be found and the bug will not be found.
Stylistic differences in using-I know the answer(it's42)-Site Home-MSDN Blogs
However, I don't see many codes that MS recently released as OSS that have this rule applied to them, so I think it's okay to remove this rule gently.
However, if you want to use an alias-intensive coding style, it might be safer to set it up.
© 2024 OneMinuteCode. All rights reserved.