I've ReSharper v9.0 installed on my VS. I also use StyleCop. I've disabled SA1200, so when I put the using
statements outside the namespace, I don't get warned again. But when I add a reference via [alt]+[enter], which isn't available in using statements, R# put it inside the namespace. Of course, it is not consistent right, R# should place it outside the namespace.
I've tried to reset R# setting to factory default, it works as I expected. But when I apply StyleCop rules again, this problem happen again. How should I setup this?
As a rule, external using directives (System and Microsoft namespaces for example) should be placed outside the namespace directive. They are defaults that should be applied in all cases unless otherwise specified.
To add an imported namespaceIn Solution Explorer, double-click the My Project node for the project. In the Project Designer, click the References tab. In the Imported Namespaces list, select the check box for the namespace that you wish to add. In order to be imported, the namespace must be in a referenced component.
Answer from another question:
UPDATE - Resharper 9: This option is now moved to Code Editing -> C# -> Code Style https://stackoverflow.com/a/825256/67420
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With