删除多余的using语句

发布于 2024-07-29 12:39:11 字数 137 浏览 1 评论 0原文

有谁知道有一个工具可以从类或整个解决方案中删除多余的 using 语句?

我正在使用重构! addin 具有“将类型移动到单独文件”智能标记,但它采用原始类中的所有 using 子句。

Does anyone know of a tool to remove redundant using statements from classes, or a whole solution?

I'm using the Refactor! addin which has a "move type to separate file" smart tag, but it takes all the using clauses from the original class with it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

哭泣的笑容 2024-08-05 12:39:22

ReSharper 可以做到这一点。

ReSharper does this.

任谁 2024-08-05 12:39:20

PowerCommands for Visual Studio 将“删除使用”的默认 VS.NET 2008 功能升级到整个项目或解决方案。

我用它所有的时间。 它还具有许多其他有用的功能 - 请查看。

最重要的是它是免费的。

PowerCommands for Visual Studio upgrades the default VS.NET 2008 functionality of "Remove Usings" to an entire project or solution.

I use it all the time. It also has a lot of other useful features- check it out.

Best of all it is FREE.

很糊涂小朋友 2024-08-05 12:39:18

Resharper 在这方面做得很好。

Resharper does this pretty well.

迟月 2024-08-05 12:39:17

VisualStudio 2008 开箱即用地执行此操作。

只需在代码窗口中右键单击 -> 组织使用 -> 删除未使用的用途。

您可以设置快捷键来执行此操作,如此处所述。

VisualStudio 2008 does this out of the box.

Simply right click in the code window -> Organise Usings -> Remove Unused Usings.

You can set up a shortcut key to do this, as explained here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文