简体   繁体   English

让ReSharper继续“使用系统”; 优化使用时

[英]Have ReSharper keep 'using System;' when optimizing usings

I was wondering if there is some option to keep ReSharper from removing just the using System; 我想知道是否有一些选项可以让ReSharper不再using System; directive? 指示? Perhaps this is configurable somewhere? 也许这可以在某处配置?

Also, is there a way to have ReSharper sort the remaining directives just as Visual Studio 2008 does it (alphabetically, I think)? 另外,有没有办法让ReSharper像Visual Studio 2008那样对剩余的指令进行排序(按字母顺序,我认为)?

Thanks. 谢谢。

Yes, there is such an option: ReSharper->Languages->C#->Namespace Imports. 是的,有这样一个选项:ReSharper-> Languages-> C# - > Namespace Imports。 You can add namespaces,that should not be removed, as well as namespaces, that should always be imported. 您可以添加不应删除的名称空间以及应始终导入的名称空间。

Yes, in the options ( Resharper > Options > Languages > C# ), there is a Namespace Imports section that allows you to specify namespaces that should never be removed. 是的,在选项( Resharper > Options > Languages > C# )中,有一个Namespace Imports部分,允许您指定永远不应删除的名称空间。 You would put System into the prompt it gives. 您可以将System置于其提供的提示中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 NUnit 和 Resharper 时出现 System.BadImageFormatException - System.BadImageFormatException while using NUnit and Resharper 在没有Resharper的C#项目中删除未使用的引用(!= usings)? - Remove unused references (!= usings) in C# project without Resharper? 重新排序使用并将它们保留在命名空间的外部 - Reorder usings and keep them OUTSIDE of the namespace Resharper - 在进行代码清理时保留命名参数 - Resharper - keep named parameters when doing code cleanup VS2012 Sort Usings 不会先移动 System Usings? - VS2012 Sort Usings doesn't move System Usings first? 使用倍数“用法”,这如何影响性能? - Using multiples “usings”, how this affect performance? Resharper和Productivity Power Tools争夺我的使用权。 我怎么能阻止流血? - Resharper and Productivity Power Tools fight over my usings. How can I stop the bloodshed? Resharper是否有助于提高系统性能? - Does Resharper helps with System Performance? ReSharper - 使用Microsoft.Contracts时可能的空值分配 - ReSharper - Possible Null Assignment when using Microsoft.Contracts Resharper - 在C#中使用“prop”快捷方式时禁用“帮助” - Resharper - Disable 'help' when using “prop” shortcut in C#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM