문제

The organize usings option in Visual Studio 2013 doesn't match the style cop rule SA1208. For example:

The Organize usings would put them in:

Namespace.Entities;
Namespace.Interfaces;
System;
System.Linq;

But SA108 requires the system ones first.

System;
System.Linq;
Namespace.Entities;
Namespace.Interfaces;

Is there a way to make visual studio behavior match the StyleCop rule?

도움이 되었습니까?

해결책

By default, my Visual Studio installation already sorts System usings first.

But you can change it. See here (check the note).

Go to Tools -> Options -> C# (I assume you are working on a C# project) -> Advanced. Then check the box saying "Place 'System' directives first when sorting usings"

EDIT: For recent versions, MS moved the documentation to a different page: see here (check the Organize usings section).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top