Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / January 2008

Tip: Looking for answers? Try searching our database.

OpenMappedExeConfiguration and configuration, configSections,     sectionGroup values

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave - 04 Jan 2008 21:59 GMT
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(fileMap,
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("MultiInvocationGroup/
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
Dave - 07 Jan 2008 18:09 GMT
> I'm access a non default application config file with
> OpenMappedExeConfiguration() and it works great for "appSettings"
[quoted text clipped - 23 lines]
>
> any help would be much appreciated, thanks, dave

So does no one know the answer to this?  I'm a bit surprised...

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.