否,但它会影响 IDE 性能和项目的编译过程。我可以给你一个简短的例子。如果您曾经使用过来自 devexpress 的 coderush http://devexpress.com/Products/Visual_Studio_Add-in/Coding_Assistance/,他们的 IDE 优化器和代码优化器也会建议您删除未使用的命名空间。
更新:这里是来自 Dmitriy 博客的更多使用信息 在 C# 代码中删除未使用的使用的原因很少。
•It is useless code, that just creates clutter in your source code and it also confusing for the developer because you don’t know which namespaces are actually used.
•Over time as your code changes it can accumulate a lot of unused using statements which create even more clutter in you code.
•It can make your compiling faster, since compiler does not have to look up all those extra unused namespaces.
•It will help avoid name conflict with new items that you going to add to your solution if both of those have same names.
•It will reduce number of items in your Visual Studio editor auto completion
有几种方法可以删除那些未使用的用途,您可以在每个文件上单独执行
http://msdn.microsoft.com/en-us/library/bb514115.aspx
您还可以下载名为 batchFormat for Visual Studio 2010 的插件,它可以帮助您删除整个项目中所有未使用的用途。
http://www.addictivetips.com/windows-tips/batch-format-remove-unused-usings-and-format-visual-studio-document/