IConfigurationSectionHandler - how does one implement it?
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngbeta' list.


Stuart C. Salsbury
I'm having trouble with a custom configuration section handler, and I found
some posts to the aspngconfig list that indicate that others are, too.

However, there were no responses to the questions raised in aspngconfig, so
perhaps with a larger audience someone who can help will be found!

Basically, to implement a custom configuration section handler, you're
supposed to implement the IConfigurationSectionHandler. However, only the
built-in configuration section handlers seem to be creatable at runtime.
The framework says that it can't create the object when it reads my
config.web. This has happened to others, too. I've been through some of
the working implementations from system.web.dll in ILDASM and can't see any
difference between my class and the others (other than that mine is
simpler).

One idea I've heard is that such classes need to come from a shared
assembly.

Can anyone provide guidance?

Thanks in advance,
Stuart Salsbury
Ernst & Young LLP

Reply to this message...
 
    
Stuart C. Salsbury
Thanks, Luis and Andy. It turned out that I needed to specify the assembly
in the configsections' <add /> element... which is a little inconsistent b/c
in other places in config.web (e.g. custom IHttpHandler's <httphandlers/>
element) I haven't had to specify it.

I'd be curious as to what the difference is between the reader for the
<configsections/> element (which seems to require my assembly to be named
specifically, and which I actually don't know which class does the job) and
the <httphandlers> element (which doesn't require my assembly to be named,
and which I know to be the class
System.Web.Configuration.HttpHandlersSectionHandler).

Anyway, I guess I'll be more thorough with assembly specification from
herein. I'm still in awe of how much power is in asp.net vs.
good-old-fashioned asp... I hope I never have to think about writing an
ISAPI extension again (perhaps that's optimistic, but I don't think so).

Thanks,
Stuart

-----Original Message-----
From: Luís Santo-Tomás Gutierrez [mailto:Click here to reveal e-mail address]
Sent: Monday, May 07, 2001 4:44 AM
To: aspngbeta
Subject: [aspngbeta] RE: IConfigurationSectionHandler -- how does one impl
ement it?

Hi Stuart,

Probably the class is right but just the framework don't find

Check this two points:
1. In config web you indicate the name of the class AND THE NAME OF THE
ASSEMBLIE wich contain it
In config web you need a line like this:
<add name="TAO" type="NameSpace.Class, YourAssembly" />
2. You deploy the assembly in a visible location (bin directory, assembly
cache, so on)

Hope this helps old companion (I'm an ex-cap gemini :))

Luis Santo Tomas

-----Mensaje original-----
De: Stuart C. Salsbury [mailto:Click here to reveal e-mail address]
Enviado el: viernes, 04 de mayo de 2001 22:01
Para: aspngbeta
Asunto: [aspngbeta] IConfigurationSectionHandler -- how does one
implement it?

I'm having trouble with a custom configuration section handler, and I
found
some posts to the aspngconfig list that indicate that others are, too.

However, there were no responses to the questions raised in aspngconfig,
so
perhaps with a larger audience someone who can help will be found!

Basically, to implement a custom configuration section handler, you're
supposed to implement the IConfigurationSectionHandler. However, only
the
built-in configuration section handlers seem to be creatable at runtime.
The framework says that it can't create the object when it reads my
config.web. This has happened to others, too. I've been through some
of
the working implementations from system.web.dll in ILDASM and can't see
any
difference between my class and the others (other than that mine is
simpler).

One idea I've heard is that such classes need to come from a shared
assembly.

Can anyone provide guidance?

Thanks in advance,
Stuart Salsbury
Ernst & Young LLP

Reply to this message...
 
 
System.Configuration.IConfigurationSectionHandler
System.Web.IHttpHandler




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com