app.config file...?

Celemar

Newcomer
Joined
Jan 20, 2006
Messages
1
Location
Johannesburg
i'm trying to create a custo section in my app.config file,

this is my config file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="myCustomSection"
type="System.Configuration.NameValueSectionHandler,
System, Version=1.0.3300.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" />
</configSections>

<myCustomSection>
<add key="Test" value="Testing" />
</myCustomSection>
</configuration>

this is my code:
NameValueCollection nvc = new NameValueCollection();
nvc = ((NameValueCollection) ConfigurationSettings.GetConfig("myCustomSection"));
string Value = nvc["Test"];

this is the error i get on the second line of code:
An unhandled exception of type 'System.Configuration.ConfigurationException' occurred in system.dll

Additional information: Could not create System.Configuration.NameValueSectionHandler,
System, Version=1.0.3300.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089

can anyone help...?
 
Back
Top