This project has moved. For the latest updates, please go here.

Why do you put namespace before using?

Mar 29, 2012 at 1:24 PM
Edited Mar 29, 2012 at 1:24 PM

Hi again,

I wonder why the extension changes Visual Studio so that namespaces are written before using directives? I know this can have some consequences, but is that required by License Header Manager? I'd rather not (as in my company, we're using the "using before namespace" policy). Could this become an optional setting?

Regards

Coordinator
Mar 30, 2012 at 9:14 AM
Edited Mar 30, 2012 at 9:57 AM

Hi,

What exactly do you mean? If I'm understanding you correctly, you're used to code like this:

using System;
namespace MyNamespace
{
  // ...
}

But now your code suddenly became like this:

namespace MyNamespace
{
  using System;
  // ...
}

Did I get this right? If yes, the LHM extension should not influence at all where Visual Studio puts the using directives. In fact, we're also following the "using before namespace" policy, and LHM works just fine. I don't even know if there is a setting to configure where Visual Studio puts the directives, but I'm quite sure that LHM doesn't change it.

(Of course, there are many other extensions and add-ins that do affect the placing of using directives. For example, ReSharper can be configured to move using directives in and out of namespaces.)

Regards,
Fabian