Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is it a bad idea to save dynamic data in web.config?

My company has an application which stores one value programatically in web.config file. The web.config file is updated about once every five minutes.

James Curran posts that it is a bad idea to modify web.config programatically in this answer Dynamically change connectionString in web.config but he does not explain why it is a bad idea.

I'm looking for reasons to convince my boss to not store any dynamic data in the web.config file. Links to good articles would be especially appreciated.

like image 495
aaaa bbbb Avatar asked Feb 24 '11 22:02

aaaa bbbb


3 Answers

The application restarts every time you modify web.config, for starters.

like image 167
Jamie Treworgy Avatar answered Nov 20 '22 05:11

Jamie Treworgy


It is bad idea because every time you modify config file the web application will restart. Also, if you are using "web site" project it will also be compiled every time you modify config. So you will have performance and responsicness issues. You boss probably don't want that:)

like image 39
Tom Kris Avatar answered Nov 20 '22 05:11

Tom Kris


In addition to the application restarting, you have several security related values stored in your Web.config file. Your application shouldn't even have write permissions to that file.

like image 22
Paul Alexander Avatar answered Nov 20 '22 04:11

Paul Alexander