tags:

views:

43

answers:

3

hi,

In my MVC application ,I am updating my web.config at runtime through application_start event.So, ideally it should be done only when the application is started.BUT in MY mvc application the application_start event of global.asax is being called multiple times , even when i have not restarted the application.

Its being repetadly called when i am calling different actions , so the webconfig is repetedly updating & making my application very very slow.

Can you please let me know , what's the reason & how to handle this .

Thanks in advance Aayushi

A: 

I dont know which elements in your web.config you are updating. If these are custom elements maybe you can put these things in a separate config file (xml file) and update that file.

Roger
+1  A: 

Everytime you change something in your web.config. That will refresh your application, therefore application_start is also called everytime you open your site. When web.config is changed, your application restarts.

rob waminal
A: 

You application will be restarted once web.config is modified.

It doesn't make any sense changing web configuration file in application_start. Moving changeable part into a separate file

Jun1st