为什么默认情况下新项目中不包含 System.Configuration 程序集?

发布于 2024-09-25 14:00:49 字数 173 浏览 2 评论 0原文

小宠物生气。创建新的 Visual Studio 项目时,有什么方法可以默认包含 system.configuration 程序集?我的几乎所有新项目都需要访问配置 AppSettings。

我知道做Project并不费力>添加参考,但我想这对大多数人来说是非常常见的事情,并且想知道为什么默认情况下不包含它?

Small pet peev. When creating new visual studio projects is there any way to include the system.configuration assembly by default? Almost all of my new projects will need access to the configuration AppSettings.

I know it's not much effort to do Project > Add reference, but I imagine that this is a very very common thing for most people and wondered why it's not included by default?

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

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

发布评论

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

评论(2

谜兔 2024-10-02 14:00:49

您可以通过创建自己的项目模板(其中包含对 System.Configuration.dll 的引用)来完成此操作。以下链接演示了如何执行此操作

至于为什么会出现今天的情况,我认为您不会找到可靠的答案。

You can do this by creating your own project template that includes a reference to System.Configuration.dll. Here is a link that has a walk through on how to do this

As to why the behavior is what it is today, I don't think you'll find a solid answer about that.

逆光飞翔i 2024-10-02 14:00:49

您可以自定义自己的模板:

http://msdn.microsoft.com/ en-us/magazine/cc188697.aspx#S3

请注意,此链接已过时,但我认为情况没有太大变化。

编辑:您也可以遵循类似的文件模板方法,即您可以自定义标准 C# 类文件布局、用户/自定义控件模板等。我已使用它来自定义哪些 using 语句默认包含,并在文件顶部插入默认注释块。

编辑:此程序集默认包含在 VS 2010 Web 应用程序中,因此也许这只是一个疏忽,或者有人过于热心地尝试简约。

You can customize your own template:

http://msdn.microsoft.com/en-us/magazine/cc188697.aspx#S3

Note that this link is old, but I don't imagine things have changed much.

EDIT: you can follow a similar methodology for file templating as well, i.e. you can customize the standard c# class file layout, user/custom control templates, etc. I have used this to customize which using statements are included by default, and to insert default comment blocks at the top of the file.

EDIT: this assembly is included by default in VS 2010 web applications, so perhaps it was just an oversight, or someone was overzealous in their attempts to be minimalist.

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