Asp.net Forum

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds

web.config programmatically

  Asked By: Joel    Date: Jul 06    Category: Asp.net    Views: 7516

has anyone got any info / samples/ links on adding sections to web.config through code

i.e. using (i think)

public interface IConfigurationSectionHandler



4 Answers Found

Answer #1    Answered By: Benny Torres     Answered On: Jul 06

I found all them, it's not what I want ( thats all about making custom settings)

What I want to do is to be able to set configurations through code.

i.e. Asp.NET will read the web.config file and set internal configurations using those read, xml values.

I want to be able to set those same internal configurations using code  instead of the xml.

Anyone any ideas ?

I know what you are going to say - that the web.config is read before any assemblies are loaded, and the values within the xml are static and cannot be altered during execution .... if anyone knows for sure then please let me know.

Answer #2    Answered By: Ulfah Hashmi     Answered On: Jul 06

what I am trying to say is that ok, maybe the web.config is read before execution and I'd agree that you cannot change it during execution ( since it recompliles on any alteration) ... but I am not asking if I can change the file - I am asking whether or not I can set or change, through code, those internal values that are set when the web.config file is read.

Answer #3    Answered By: Adaulfo Fischer     Answered On: Jul 06

everything I've read now seems to point to going outside the webapp and into admin and WMI and so forth.

So I take it I just add and remove a httpHandler programmatically, probably because that process is actually altering the IIS Virtual directory the web  app is running under.

is this about the run of things ????

Some one please advise.

Answer #4    Answered By: Nicholas Wells     Answered On: Jul 06

Ok ... methinx me cannot add httphandler programmatically  ....

anyone got any advice on overriding or extending an existing system httphandler (perhaps the one used for *.cs) .... or is that a monstrous task ?

Didn't find what you were looking for? Find more on web.config programmatically Or get search suggestion and latest updates.