Domanda

I have exactly opposite problem to one described here. In my case Visual Studio inserts using directives inside namespace and I want to prevent this. I did try to uncheck Resharper option: Languages -> C# -> Formatting Style -> Namespace Imports -> Add using directive to the deepest scope And it didn't help. Also I tried to temporary disable the Resharper. Still same issue. Btw, I have StyleCop and StyleCop+ installed as well. Maybe it is causing the issue. So right now when I go and Add New Item -> Class - it will create new code file with using directives inside namespace. How to change this?

È stato utile?

Soluzione

Have you replace your class template file with one that has one or more using directives inside the namespace declaration? If so, you're probably seeing the result of an interesting bit of C# plugin behavior: a newly added using directive is placed after the last recognized using directly already in the file, regardless of where that is.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top