ReSharper 2025.2 Help

命名空间导入

ReSharper 选项:代码编辑 | C# | 命名空间导入

此页面包含影响 ReSharper 在现有代码库中 优化命名空间导入指令方式的选项。

ReSharper 还允许您调整影响命名空间导入样式的一些设置。 您可以在 ReSharper 选项 的 代码编辑 | C# | 语法样式 页面 Alt+R, O 上查看和更改这些设置。

仅移除未使用的别名

如果别名名称与符号名称不同,则保留

如果选中 仅移除未使用的别名 复选框,您可以选择保留非简单别名的 using 指令,即使它们是多余的。 否则,ReSharper 会移除所有多余的 using 指令。

不应移除的命名空间

ReSharper will not report usings of these namespaces as redundant, and will not remove them while running code cleanup.

应始终导入的命名空间

ReSharper 在运行 代码清理时将始终为这些命名空间添加 using。

永远不应从完全限定类型名称中移除的命名空间

ReSharper will not report these namespaces in fully qualified type references as redundant, and will not remove them while running code cleanup.

最后修改日期: 2025年 9月 27日