Two projects, one app.config?

D

David

Hi all,

I am creating a windows application to basically be a front end to a windows
service.

There will be a lot of common configuration data between the two programs.

Is it possible to use one config file for both programs? If so, how do I set
it up to do this? (I can easily put both the service and app in the same
folder)

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
 
J

Jeff Johnson

I am creating a windows application to basically be a front end to a
windows service.

There will be a lot of common configuration data between the two programs.

Is it possible to use one config file for both programs? If so, how do I
set it up to do this? (I can easily put both the service and app in the
same folder)

When you create a custom configuration section, you can specify a separate
file as the source of the section's data. Something like this:

<configuration>
<configSections>
<section name="MyCompany.MyProduct.CustomConfigurationSection"
type="MyCompany.MyProduct.CustomConfigurationSection, MyCompany.MyProduct"/>
</configSections>
<MyCompany.MyProduct.CustomConfigurationSection
configSource="External.config" />
</configuration>

So now you could set the configSource property to point to the same file
(External.config in this example) in both projects's app.config.
 

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

Similar Threads


Top