^

Load an XML exe.config File (Custom Path)

Article 54 in C-Sharp

2020-09-24 07:36:29 from bugfish
Load an XML exe.config File (Custom Path)
C-Sharp / Hints
Last Review on: 2021-03-07 14:00:58 | Hits: 136

Here an example to load an custom application xml config file.

// Load Configuration
CurrentConfPath = "C:\PATH\TO\EXE.CONFIG";
ExeConfigurationFileMap configMap = new ExeConfigurationFileMap();
configMap.ExeConfigFilename = CurrentConfPath;
Configuration config = ConfigurationManager.OpenMappedExeConfiguration(configMap, ConfigurationUserLevel.None);

// Get a Value
config.AppSettings.Settings["NameOfValue"];

 

I do not guarantee the reliability of the information given here, the code described on this page is executed at your own risk and in the event of damage or other unforeseeable consequences I am in no way responsible or liable.
Comment Section
Currently 1 Upvotes!
captcha image

System - 2021-01-02 16:47:09
We appreciate comments on our site!

This Website is using Session Cookies for Site Functionality and AWStats.
Radio