Load an XML exe.config File (Custom Path)

ID - _BUGFISH - E#54
^Top
<< Back
Mobile-Menu










Load an XML exe.config File (Custom Path)
Category: C-Sharp
Sub-Category:
Creator: Jan-Maurice Dahlmanns
Created: 2020-09-24 07:36:29
Modified: 2024-11-19 04:32:49
Views: 635

Caution: 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.

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"];

 

Currently 0 Upvotes!

captcha image
System - 2024-11-05 18:29:26
Commenting System Initialized! Have a very nice day!

Switches: 0 | Arrivals: 9 | Visits: 9
This Website is using Session Cookies for Site Functionality.