We would like to Reorder using statements
and keep them outside of the namespace
. ReSharper puts them inside the namespace
when reordering.
Visual Studio or Resharper functionality for placement of using directives asks how to put usings
inside the namespace.
That is not what we would like to do. Its answer suggest going to ReSharper > Options > Code Editing → C# → Code Style → Add 'using' directive to the deepest scope
. Despite having un-selected that, on re-ording the usings
, ReSharper places the usings inside the namespace
.
How can we Reorder using statements
and keep them outside the namespace
?
Additional things we have tried:
Our StyleCop.Analyzers ruleset includes the following directive related rules:
SA1200 Using directives must be placed correctly
SA1208 System using directives must be placed before other using directives
SA1209 Using alias directives must be placed after other using directives
SA1210 Using directives must be ordered alphabetically by namespace
Given those rules along with the selection in Options not to "Add usings
to the deepest scope", we receive the following warning on build:
SA1200 Using directive must appear within a namespace declaration.
How can we configure ReSharper to enforce that using directives must appear outside a namespace declaration?