How can I share Configuration Settings across multiple projects in Visual Studio?

Posted by Muneeb on Stack Overflow See other posts from Stack Overflow or by Muneeb
Published on 2010-05-13T12:46:47Z Indexed on 2010/05/13 12:54 UTC
Read the original article Hit count: 283

Filed under:
|

Ok I know this may be a design issue, so I would love to have remarks on that as well.

I have a Visual Studio web application solution. I have three projects as UserInterface, BusinessLogic and DataAccess.

I had to store some user defined settings and I created configSections in the config file.

I access these configSections through classes which inherit from .NET's ConfigurationSection base class.

So in short for every project I had a separate configSection and for that corresponding configSection I had a class in that project inheriting from ConfigurationSection to access the config section settings.

This works all sweet. But the problem arises if there is any setting which I need to use across multiple projects. So If I need to use a setting defined in UserInterface project configSection in, let say, BusinessLogic project I have to actually make a copy of that setting in the BusinessLogic's configSection. This ends up having the same setting copied across multiple configSections.

Isn't this a bit too redundant?

© Stack Overflow or respective owner

Related posts about visual-studio

Related posts about design