I am trying to add custom nodes to my web.config file and I am running into a few issues. It looks something like this:

VB Code:
  1. <configuration>
  2.     <configSections>
  3.         <section name="MySection" type="MySectionHandler"/>
  4.     </configSections>
  5.  
  6.  
  7. <MySection>
  8. <CustomNode>1</CustomNode>
  9. <CustomNode>2</CustomNode>
  10. <CustomNode>3</CustomNode>
  11. <CustomNode>4</CustomNode>
  12. </MySection>
  13. ...
  14. </configuration>

Then I have the code for mysectionhandler as follows:

VB Code:
  1. Public Class MySectionHandler
  2.     Implements IConfigurationSectionHandler
  3.  
  4.     Public Function Create(ByVal parent As Object, ByVal configContext As Object, ByVal section As System.Xml.XmlNode) As Object Implements System.Configuration.IConfigurationSectionHandler.Create
  5.         Return "HELLO"
  6.     End Function
  7. End Class

Finally, I have my code that trys to display the values:

VB Code:
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2.         TextBox1.Text = ConfigurationSettings.GetConfig("MySection")
  3.  
  4.     End Sub

I am getting an error on the Configuration.GetConfig line. The error I am getting is:

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Exception creating section handler.

It and it highlights the <section name="MySection" type="MySectionHandler"/> line in the Web.Config file.

Anyone seen this before, or can anyone offer any suggestions?