Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the System.Configuration assembly not included in new projects by default?

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?

like image 575
Fixer Avatar asked Sep 29 '10 15:09

Fixer


2 Answers

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

  • http://msdn.microsoft.com/en-us/vstudio/cc703626.aspx

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

like image 174
JaredPar Avatar answered Nov 03 '22 00:11

JaredPar


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.

like image 43
Tim M. Avatar answered Nov 03 '22 00:11

Tim M.