473,625 Members | 3,357 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

OpenMappedExeCo nfiguration and configuration, configSections, sectionGroup values

I'm access a non default application config file with
OpenMappedExeCo nfiguration() and it works great for "appSetting s"
values, but I cannot get it to work for configSection values / with
NameValueCollec tion.

Here is some sample code:

ExeConfiguratio nFileMap fileMap = new ExeConfiguratio nFileMap();
fileMap.ExeConf igFilename = @"C:\Program Files\KAF\bin
\Latch2.exe.con fig";
System.Configur ation.Configura tion configFile =
ConfigurationMa nager.OpenMappe dExeConfigurati on(fileMap,
ConfigurationUs erLevel.None);

// the following works fine
int userLoginFreque ncy =
Convert.ToInt32 (configFile.App Settings.Settin gs["UserLoginFrequ ency"].Value);

// but this does not work - jrArgsCollectio n being null
NameValueCollec tion jrArgsCollectio n = (NameValueColle ction)
ConfigurationMa nager.GetSectio n("MultiInvocat ionGroup/
JRArgumentsSect ion");

the latter syntax worked great when i was using OpenExeConfigur ation()
instead of OpenMappedExeCo nfiguration() but it doesn't work anymore.

any help would be much appreciated, thanks, dave
Jan 4 '08 #1
1 7321
On Jan 4, 1:59*pm, Dave <djohanns...@gm ail.comwrote:
I'm access a non default application config file with
OpenMappedExeCo nfiguration() and it works great for "appSetting s"
values, but I cannot get it to work for configSection values / with
NameValueCollec tion.

Here is some sample code:

ExeConfiguratio nFileMap fileMap = new ExeConfiguratio nFileMap();
fileMap.ExeConf igFilename = @"C:\Program Files\KAF\bin
\Latch2.exe.con fig";
System.Configur ation.Configura tion configFile =
* * ConfigurationMa nager.OpenMappe dExeConfigurati on(fileMap,
ConfigurationUs erLevel.None);

// the following works fine
int userLoginFreque ncy =
Convert.ToInt32 (configFile.App Settings.Settin gs["UserLoginFrequ ency"].Value*);

// but this does not work - jrArgsCollectio n being null
NameValueCollec tion jrArgsCollectio n = (NameValueColle ction)
* * ConfigurationMa nager.GetSectio n("MultiInvocat ionGroup/
JRArgumentsSect ion");

the latter syntax worked great when i was using OpenExeConfigur ation()
instead of OpenMappedExeCo nfiguration() 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
2753
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 like: ================================================ <?xml version="1.0" encoding="utf-8" ?>
0
5312
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 written in C#. I created a small .exe file to test that the library builds propertly from configuration and that it communicates properly. This work great in the System.Windows.Forms. However, when I use the library in a web enviroment things...
2
3209
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> <sectionGroup name="cbsoffice"> <section name="data" type="CbsOffice.ProviderConfigurationHandler,CbsOffice"/>
8
1580
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 ASP.NET 2.0. Where can I see what was change and how I can migrate? Thank you Shimon.
0
1001
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 name="mainsection"> <section name="ConnectionString" type="System.NamevaluesectionHandler,System" /> </sectiongroup>
7
1740
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 catalog=test;password=test" /> </appSettings> <mysettings> <add key="intErrorLogtype" value="1" />
2
3619
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 Windows Service must call a Web Service every now and then. I have added the web reference, and made it dynamic, so I can change the
3
3860
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 app.config). The only configuration reading I have used before is AppSettings and I have also used Spring Framework. It is more the type of configuration that Spring uses I am looking at now.
1
2872
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 does not read my app.config (given below). Could someone please give me a quick hint as to what can I do to fix this?
0
8256
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8189
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8694
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8635
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8356
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8497
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2621
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 we have to send another system
2
1500
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.