Share configurable application settings between projects in a vsnet solution

M

Meteor

I have a vs2005 solution containing about 5 projects, three of which
have their own .settings files.

When I deploy the application, I want all the settings to be in one
place - configurable - presumably in an app.config file where I can
edit them. The settings will be used by a windows service,
filewatcher, database access application.

How do I achieve this?

As a workaround, I have created an additional project which contains a
single static class with static property accessors pointing to values
from an internal settings file.
I've consolidated all the settings information from the other projects
into that one project. I then referenced that project from all the
others and used it's settings via the static class properties.

Does that sound like the right approach?

I just had the idea that I might be missing something. I've downloaded
the Configuration Application Block and am investigating that,
thinking that it might help me. As usual, there's bucketloads of
general information on the application block, but nothing succinct, so
I'm going to have to do the hard yards until I find something
pertinent.

Any advice would be much appreciated.
 
M

Mr. Arnold

I just had the idea that I might be missing something. I've downloaded
the Configuration Application Block and am investigating that,
thinking that it might help me. As usual, there's bucketloads of
general information on the application block, but nothing succinct, so
I'm going to have to do the hard yards until I find something
pertinent.

That's where you need to go. Why re-invent the wheel? It has it all with
examples and everything about working with App.config in just the download
for .Net 2.0. All you have to do is reference the App Block Dll(s) which are
part of VS 2005 and the .NET 2.0 Framework, or with VS 2003 and with .Net
1.1 Framework, you have to download and install CAB and add reference to the
right Dll(s) in your project.
 
M

Meteor

Unfortunately it looks like there's no Configuration Application Block
in the latest offering of the Enterprise Library.
Back to the drawing board.
 
M

Mr. Arnold

Meteor said:
Unfortunately it looks like there's no Configuration Application Block
in the latest offering of the Enterprise Library.
Back to the drawing board.

Yes, there is no Enterprise Library for Framework 2.0. All of it has been
moved to the System.Configuration namespace.

http://www.dotnetfun.com/articles/framework/2.0/WhatsNew20ConfigurationManager.aspx

Every last bit as far as Configuration Application Block, is in
ConfigurationManager. I have used the Configuration Application Block
Enterprise solutions on Framework 1.1 and the ConfigurationManager on
Framework 2.0. They are the same solutions.

All you're going to get on the download for Config App Block for Framework
2.0 are documentation, examples and demos for VB and C#.NET on how to use
ConfigurationManager.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top