Chinjoo
Chinjoo

Reputation: 2792

Should all the using directives for namespaces be inside the namespace?

Microsoft StyleCop provided a warning when the using directives for namespaces are provided outside of the namespace. Is this really required as my view on this is that using dircetives for namespaces is for providing a alias name for namespace and for removing the need for providing the namespace name when a class/interface is used. I dont think it will be used for loading the assembly.

Upvotes: 0

Views: 370

Answers (1)

Johnny
Johnny

Reputation: 1575

It's basically your choice. But as we follow Microsoft and this is their standard it's good to have your all usings inside your name space. And also have them sorted.

Upvotes: 1

Related Questions