473,399 Members | 3,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

reading from app.config

hey all,

can someone please tell me how to get the following to work?

console app
NameValueCollection nvColl =
(NameValueCollection)ConfigurationManager.GetSecti on("heading1/subheading1");

app.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<heading1>
<subheading1>
<add key="name1" value="value1"/>
<add key="name2" value="value2"/>
</subheading1>
</heading1>
</configuration>

i'm getting a "failed to initialize" on .GetSection call

thanks,
rodchar
Nov 8 '08 #1
2 2463
Here is a thread on the topic:

http://social.msdn.microsoft.com/For...-fb089c395c73/
"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:00**********************************@microsof t.com...
hey all,

can someone please tell me how to get the following to work?

console app
NameValueCollection nvColl =
(NameValueCollection)ConfigurationManager.GetSecti on("heading1/subheading1");

app.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<heading1>
<subheading1>
<add key="name1" value="value1"/>
<add key="name2" value="value2"/>
</subheading1>
</heading1>
</configuration>

i'm getting a "failed to initialize" on .GetSection call

thanks,
rodchar

Nov 8 '08 #2
thanks for "the point in the right direction,"
rod.

"rodchar" wrote:
hey all,

can someone please tell me how to get the following to work?

console app
NameValueCollection nvColl =
(NameValueCollection)ConfigurationManager.GetSecti on("heading1/subheading1");

app.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<heading1>
<subheading1>
<add key="name1" value="value1"/>
<add key="name2" value="value2"/>
</subheading1>
</heading1>
</configuration>

i'm getting a "failed to initialize" on .GetSection call

thanks,
rodchar
Nov 11 '08 #3

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

Similar topics

1
by: Sami | last post by:
Hello, I have this problem that I need your help with : I am reading a config file that contain the following : 2004 update
3
by: spacekid | last post by:
Hi there I am exposing a c# assembly as a COM component (regasm /codebase) and calling it from classic asp. When I try to call the ConfigurationSettings.AppSettings function in the c# assembly,...
2
by: news.microsoft.com | last post by:
Hi After conducting a several searches, I wasn't sure where to post this question. So my apologiesbefore hand for double posting this and possibly posting to the wrong forum(s). Okay, I have...
1
by: comic_rage | last post by:
Hi, I am trying to read from my application config file and keep getting null. Here is my config file My application is called SampleApp.exe
10
by: Ryan | last post by:
I've created a custom configuration section that inherits (naturally) from System.Configuration.ConfigurationSection. The configuration section is working 99% fine, however I keep coming across a...
2
by: marek zegarek | last post by:
Hello! On my server I have Sharepoint portal server as default web site I create there a web application folder with form.aspx file. When I'm trying to run aspx, i get an error. Page is trying...
5
by: alf | last post by:
Hi folks, I'm trying to read a web.config section using RoleManagerSection settings = (RoleManagerSection)System.Configuration.ConfigurationManager.GetSection("system.web/roleManager"); and I...
9
by: Milsnips | last post by:
Hi all. i'm tryng to implement the Rewrite.NET url rewritining functionality into a test project i've created, however i am hitting a problem at this line (direct from the web example): ...
1
by: M Irfan | last post by:
Hello all, Recently I have started working in .NET 2.0. I am developing a web service application that references a DLL component written in C# 2.0. The component has its own config file which...
1
by: vijayarl | last post by:
Hi Everyone, i have the written this logic : basically a file operation open (CONFIGFILE, "$config_file") or die; while (<CONFIGFILE>) { chomp;
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
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,...

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.