Thursday, May 5, 2011

Visual Studio or Resharper functionality for placement of using directives

Hi,

I like to put my using directives inside the current namespace, and not outside as VS and Resharper per default puts them.

Does anyone know of a macro/standard functionality that sorts/removes unused using directives and puts them inside the current namespace?

--larsw

From stackoverflow
  • I've edited my default visual studio templates to put my using directives inside the namespace.

    For sorting and removing unused directives, I use Power Commands for Visual Studio 2008.

  • Have you tried the Resharper option:

    Languages -> C# -> Formatting Style -> Namespace Imports -> Add using directive to the deepest scope

    I'm not sure whether R#'s code cleanup will reorder the existing ones for you though.

    larsw : That did the trick - thanks a bunch! :-) --larsw

0 comments:

Post a Comment