I'm migrating a perfectly working app from .Net 1.1 to .Net 2.0 b2 and I'm having very hard time to understand why I'm getting the following exception:
"An error occurred creating the configuration section handler for ColumnMappings: Could not load type 'SingleTagSectionHandler' from assembly 'System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. (C:\Documents and Settings\...\MyApp.EXE.config line 5)"
line of code where the exception occurs:
mappingTable = (IDictionary) System.Configuration.ConfigurationManager.GetSection("ColumnMappings");IDictionary
section of the .config file:
configuration><
<
configSections><
section name="ColumnMappings" type="System.Configuration.SingleTagSectionHandler"/>
Of course, this used to work perfectly with .Net 1.1 and the
IDictionary mappingTable = (IDictionary) ConfigurationSettings.GetConfig("ColumnMappings");
code.
Thank you.

Migration from 1.1 to 2.0b2 - Could not load type 'SingleTagSectionHandler' from assembly 'System.Configuration'
bjohns9959
Okay, Microsoft must have changed the way they load types from configuration file (which is a breaking change).
I suggest that you first post a bug report on Microsoft Product Feedback Center and then try this in the meantime:
<section name="ColumnMappings" type="System.Configuration.SingleTagSectionHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
mz1derful
The program throws an exception pointing to the following line in the configuration file:
<
section name="Locations" type="System.Configuration.NameValueSectionHandler" />The exception says:
"Could not load type 'System.Configuration.NameValueSectionHandler' from assembly 'System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'."
The solution mentioned here above did not help.
Any other ideas
THank you,
Gennady.
Sinc at devBiz
Sean Patzer
As far as the breaking change is concerned, MS has did his job: make me waste 2 days trying to find a solution, which hopefully I did thanks to you guys!
I guess that's the way it is when you work with MS technologies :-)
and nothing can change this...
mrgreentie
Well,
I've just changed the idea and wrote my own SectionHandler, since I didn't find any solution to the mentioned problem. The following article points out how to do this:
How to: Create Custom Configuration Sections Using ConfigurationSection
Hope this helps,
M.Mousavi
Sue Hoegemeier
Anyway, now the issue is even worse since I get the following exeption:
"An error occurred creating the configuration section handler for ColumnMappings: Could not load file or assembly 'System' or one of its dependencies. The system cannot find the file specified."
And now, I'm totally lost, :-(
For info, here's the line of the config file:
<section name="ColumnMappings" type="System.Configuration.SingleTagSectionHandler, System"/>
Thanks a lot.
HasanTariq
Hope this helps!
Donal Kelly
Change the type attribute to:
type="System.Configuration.SingleTagSectionHandler, System";
spyders
Hi Mehdi,
Thank you for your feedback. In my case, I was able to figure out the problem. I have created the Myapp.exe.config from notepad, which has the configuration sections, however, my app.config did not have those sections and when added the sections to my app.config file, the problem resolved.
Thanks
Sree
Jhonny
Dear Pejvan,
I am doing exactly the same thing, but the following code always returns null:
IDictionary mappingTable = (IDictionary) ConfigurationSettings.GetConfig("ColumnMappings");
Any idea
Cheers,
M.Mousavi
sqlplover
I have now filled a bug report about this.
One more newbie/silly question: I can't find a way to get the PublicKeyToken of an assembly. Is there any easy way to obtain it What about from within VS 2005b2
Kind regards.
Benke
That is a not a valid workaround. Copying system .NET Framework dlls locally is a bad idea and will only cause problems in the long run.
To fix this simply do the same thing as the correct answer above.
Chris L
Hi Mehdi,
I have been doing the same thing that your are doing and I am getting 'Nothing' as return (equivalent of null in c#).
Did you find a solution or work around and can you please share it with me.
Thanks
SreeAtPru
Jose San Juan