System.Configuration.ConfigurationException

B

Ben

Hi,
I have a DLL that supplies functionality to a web service and some console
applications. It reads some of its information (sensitive stuff) from the
registry and the rest from the config file of the caller. In the config file
I have several custom sections all using the NameValueSectionHandler.

Now when I run the NUnit tests using the NUnit GUI everything works fine but
when I launch the web service, it reads data from the first custom config
section, but when it encounters a subsequent call to another config section,
it throws up a Configuration Exception saying "Could not Create Handler.--
System.TypeLoad exception.

I tried putting in all the parameters for the config section such as the
Public Key etc but to no avail. Initially I had not grouped all the config
sections under one <sectionGroup>. I did this, but the same problem
persists.

Is there a recognised problem in using multiple custom sections that use the
NameValueSectionHandler in web services and web apps? Should i resort to
writing a custom config handler?

Any thoughts?

Cheers
Santosh
 
M

Marc Scheuner [MVP ADSI]

it throws up a Configuration Exception saying "Could not Create Handler.--
System.TypeLoad exception.

Hmm... sounds almost as if it can't decide which version of handler to
create - you don't happen to have both .NET 1.0 and 1.1 installed ??
TypeLoad usually means it can't load the correct version of a given
type / assembly......

Any chance you can SHOW us the offending .config file?
Is there a recognised problem in using multiple custom sections that use the
NameValueSectionHandler in web services and web apps?

Not to my knowledge, no.
Should i resort to writing a custom config handler?

That would be one way to do it, sure - but quite possibly, it's just
something small that you're facing here (and possibly overlooking in
the heat of debugging ;-)

Marc

================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top