Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

Regarding reading configuration file in web application

$
0
0
Hi,

i have a libarary file and it has its own app.config file.
I am deploying the library in a web site along with the condiguration file and while reading the configuration i am using the following code to read the settings from the libraries configuration file.

Code

ExeConfigurationFileMap

fileMap = newExeConfigurationFileMap();

Assembly asm = Assembly.GetCallingAssembly();

Uri uri = newUri(Path.GetDirectoryName(asm.CodeBase));

fileMap.MachineConfigFilename =

Path.Combine(uri.LocalPath, "library.dll.config");

Configuration

applicationSettings =
ConfigurationManager.OpenMappedExeConfiguration(fileMap, ConfigurationUserLevel.None);


Is this the correct way to do it ot is there any other way to do the same
Needs help regarding this

Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>