Configuration

E

Eric

Hi

In .NET it is possible to add a file-attribute in the appSettings-element of
a configuration-file so that if the file exists it will be used instead of
the values in the normal config-file. In .NET 2.0 there are a lot of new
configuration-sections, like connectionstrings, and the ease of using
Settings in projectfile, but I haven't seen any possibility to override that
settings in an external file. Is there anything like the file-attribute of
the appSettings, carried forward to any other parts of the configuration
system (for example in the connectionsstrings-section)?

Thanks, Eric
 
W

W.G. Ryan - MVP

Eric:

If I understand your problem correctly, you can use the
OpenMappedExeConfiguration method of the ConfigurationManager to accomplish
this
http://msdn2.microsoft.com/en-US/li...anager.openmappedexeconfiguration(VS.80).aspx
Specifically, you specify a FileMap (ExeconfigurationFileName) to accomplish
this
http://msdn2.microsoft.com/en-US/library/system.configuration.execonfigurationfilemap.aspx

If I understand you correctly, this should work, otherwise let me know and
I'll do what I can.

Cheers,

Bill
 

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