473,503 Members | 1,858 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

OpenMappedExeConfiguration and configuration, configSections,sectionGroup values

I'm access a non default application config file with
OpenMappedExeConfiguration() and it works great for "appSettings"
values, but I cannot get it to work for configSection values / with
NameValueCollection.

Here is some sample code:

ExeConfigurationFileMap fileMap = new ExeConfigurationFileMap();
fileMap.ExeConfigFilename = @"C:\Program Files\KAF\bin
\Latch2.exe.config";
System.Configuration.Configuration configFile =
ConfigurationManager.OpenMappedExeConfiguration(fi leMap,
ConfigurationUserLevel.None);

// the following works fine
int userLoginFrequency =
Convert.ToInt32(configFile.AppSettings.Settings["UserLoginFrequency"].Value);

// but this does not work - jrArgsCollection being null
NameValueCollection jrArgsCollection = (NameValueCollection)
ConfigurationManager.GetSection("MultiInvocationGr oup/
JRArgumentsSection");

the latter syntax worked great when i was using OpenExeConfiguration()
instead of OpenMappedExeConfiguration() but it doesn't work anymore.

any help would be much appreciated, thanks, dave
Jan 4 '08 #1
1 7291
On Jan 4, 1:59*pm, Dave <djohanns...@gmail.comwrote:
I'm access a non default application config file with
OpenMappedExeConfiguration() and it works great for "appSettings"
values, but I cannot get it to work for configSection values / with
NameValueCollection.

Here is some sample code:

ExeConfigurationFileMap fileMap = new ExeConfigurationFileMap();
fileMap.ExeConfigFilename = @"C:\Program Files\KAF\bin
\Latch2.exe.config";
System.Configuration.Configuration configFile =
* * ConfigurationManager.OpenMappedExeConfiguration(fi leMap,
ConfigurationUserLevel.None);

// the following works fine
int userLoginFrequency =
Convert.ToInt32(configFile.AppSettings.Settings["UserLoginFrequency"].Value*);

// but this does not work - jrArgsCollection being null
NameValueCollection jrArgsCollection = (NameValueCollection)
* * ConfigurationManager.GetSection("MultiInvocationGr oup/
JRArgumentsSection");

the latter syntax worked great when i was using OpenExeConfiguration()
instead of OpenMappedExeConfiguration() but it doesn't work anymore.

any help would be much appreciated, thanks, dave
So does no one know the answer to this? I'm a bit surprised...
Jan 7 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2737
by: serge calderara | last post by:
dear all, I have problem accessing section group in my configuration application file. I got an error saying thta I can have only one section ???? here is my application configuration looks...
0
5300
by: phillip | last post by:
This is interesting, I have attached my web.config file and the exception I have been logging. I created a library which provide data access to a database and a control system. The library is...
2
3200
by: murl | last post by:
Below is what i have as the custom section in the web.config file... <?xml version="1.0" encoding="utf-8" ?> <configuration> <!-- register local configuration handlers --> <configSections>...
8
1569
by: Shimon Sim | last post by:
Hi I converted my existing ASP.NET project to VS.NET 2005. Build gives me some warnings about config file. I have custom section definition in web.config. Were there any changes in this for...
0
997
by: Shaun Ram | last post by:
Hi, I have this constraint. A help would be greatly appreciated. I have this Config file. <?xml version="1.0" encoding="utf-8" ?> <configuration> <configsections> <sectionGroup...
7
1732
by: Richard Kerr | last post by:
Hi all, Have a look at this config file structure: <appSettings> <add key="connstr" value="workstation id=test;packet size=4096;user id=sa;data source=test;persist security info=False;initial...
2
3606
by: Jan Eliasen | last post by:
Hi I am having some problems reading configuration values from a configuration file, using C# 2.0. I have programmed a Windows Service, and this part goes well - it runs nicely. Now, the...
3
3854
by: Peter K | last post by:
Hi I need to be able to supply some relatively complex configuration to an application. The application will either run in a web context (with a web.config file, or as a application with an...
1
2864
by: John | last post by:
Hi I am looking for an editor that will allow a user to edit application configuration easily and I have found below; http://www.codeproject.com/KB/cs/configeditor.aspx Unfortunately it...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7086
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7460
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.