Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...