默认在新C#文件中使用指令 [英] Default using directives in new C# files

查看:72
本文介绍了默认在新C#文件中使用指令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么Visual Studio 2008会自动将以下 using指令插入我创建的每个新C#文件中?

Why does Visual Studio 2008 automatically insert the following using directives into each new C# file I create?

using System; 
using System.Collections.Generic; 
using System.Text;

这些命名空间有什么特别之处?这些是最常用的吗?

What's so special about these namespaces? Are these the most frequently used ones?

推荐答案

是的,它们很常用,仅此而已,因此MS将它们放在

Yes, they're frequently used, that's all, so MS put them in the Visual Studio templates. Personally I use "sort and remove unused usings" pretty frequently, so they often go away.

如果要删除它们,可以.

If you want to remove them, you can amend the "new class" template.

如果您成为使用指令排序和删除未使用的东西"的粉丝,则应该掌握

If you become a fan of "Sort and Remove Unused Using Directives" you should get hold of PowerCommands for Visual Studio - that adds a Solution Explorer context menu item to do it for a whole project instead of just one file :)

这篇关于默认在新C#文件中使用指令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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