views:

56

answers:

2

Each time I try to add a very basic section into app.config I get the following error:

Configuration system failed to initialize.

I have looked at the variety of articles but none of those has helped so far. Any ideas what is going wrong?

Edit:

  <configSections>
    <section name="Test" type="TestType"/>
  </configSections>

  <Test>  

  </Test>
+1  A: 

Do you define a configuration section handler? Here is a tutorial:

http://support.microsoft.com/kb/309045

Edit: (Based on your updated question) I recommend to specify the type with the fully qualified assembly name.

Stefan Egli
Hey, yes I have just came across few articles online. I have moved configSection to the top of the file and I get the following exception: An error occurred creating the configuration section handler for Test: Could not load type 'TestType' from assembly 'System.Configuration, Version=4.0.0.0, Culture=neutral)... I guess now I have to figure out what type it should have.
vikp
just specify the type with "type, assembly, version, culture, public key token" (the link about fully qualified assembly name is not as good as I would like)
Stefan Egli
maybe this makes it clearer: http://threeisit.com/post/Fully-qualified-assembly-names.aspx
Stefan Egli
Is there a simpler workaround? What are the chances of assembly, version, culture or public key token changing?
vikp
you probably get away with just specifying "type, assembly", but as the other values in your case probably never change... why not just specify them as well
Stefan Egli
Oki, thank you very much. I'll give this a go in a second.
vikp
Have been sat with this for hours. I either can't load an assembly, or assembly gets loaded, but when I try and read data from mycustomerconfig.xml I get a null...
vikp
+1  A: 

Read/Write App.config with .NET 2.0/Enterprise http://geekswithblogs.net/akraus1/articles/64871.aspx

Pranay Rana