Celemar
Newcomer
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...?
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...?