使用指令在错误的顺序排序 [英] Using Directives Sorted in Wrong Order

查看:196
本文介绍了使用指令在错误的顺序排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是电源命令扩展与Visual Studio 2012年。我可以选择检查删除和排序保存usings。的问题是,System.Xxx指令正在最后排序,而这造成了样式分析错误:使用指令系统必须:

I'm using the Power Commands extension with Visual Studio 2012. I have the option checked to remove and sort usings on save. The problem is that the System.Xxx directives are being sorted last, and that's causing a style analysis error:

SA1208 。放在其他所有使用指令之前

SA1208: System using directives must be placed before all other using directives.

之前保存:​​

using System;
using System.Diagnostics.CodeAnalysis;
using Foo;



后保存:

using Foo;
using System;
using System.Diagnostics.CodeAnalysis;

这工作正常(System.Xxx第一)VS与2010有谁知道如何纠正呢?

This worked correctly (System.Xxx first) with VS 2010. Anyone know how to correct this?

请注意:即使没有造成一个错误SA,我还是宁愿系统的指令是第一个

Note: Even if it didn't cause an SA error, I'd still prefer the system directives to be first.

推荐答案

转到了快速启动(按Ctrl + Q),然后键入使用,然后按输入

Goto the "Quick Launch" (Ctrl+Q) and type "using" and press Enter.

然后,更改以下设置:

这是一个恼人的默认设置,我不知道为什么微软选择了,它违背了所有以前的标准,我'见过

It's an annoying default setting, I have no idea why Microsoft chose that, it goes against all previous standards that I've ever seen.

编辑:
感谢的奥斯卡我们拥有的理由

原因在默认行为的变化是由于事实上,
的Windows应用商店的应用程序更喜欢有Windows操作系统。的文件,而不是顶部
系统。

The reason for the change in default behavior is due to the fact that Windows App Store applications prefer to have 'Windows.' at the top of the file rather than 'System.'

这篇关于使用指令在错误的顺序排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆