web.config security settings
-
Hi How do I add the user "everyone" with full control to the security settings of my web.config file. I need to chane the web.config file via my web service so that I can set my connection string as required per client Regards
DON'T !!! :doh: you can use info about the connecting client to construct the connection on the fly in code. But never change web.config from code. note that changing the connection srting per client makes you loose connection pooling benifits.
Hesham A. Amin blog
-
Hi How do I add the user "everyone" with full control to the security settings of my web.config file. I need to chane the web.config file via my web service so that I can set my connection string as required per client Regards
I think the web.config is readonly in runtime 'cause the web application is forces a restart the it detects a changed web.config file. So either if you can change it I don't think its saved until the webapp restarts or the web.config is readonly in runtime.
Vasudevan Deepak Kumar Personal Homepage Tech Gossips
-
DON'T !!! :doh: you can use info about the connecting client to construct the connection on the fly in code. But never change web.config from code. note that changing the connection srting per client makes you loose connection pooling benifits.
Hesham A. Amin blog
I have to This is a fire detection server that will be standing behind a firewall and no-one can have access to it from the outside. No one will consume the web service from the outside. However for my technicians to install the system on the mine they need to change the connection string to connect to the database as the path of the data base can change on a per install base Regards
-
Hi How do I add the user "everyone" with full control to the security settings of my web.config file. I need to chane the web.config file via my web service so that I can set my connection string as required per client Regards
I wrote and article which describes how to change the web config file programmatically. I think if you follow my article you can created a domain user that you set up as the identity of your app pool that your web service runs under. Then you could change the web.config. NOTE when the web.config is change the application will restart. If you are talking about the web service changing a different web sites web.config that is pretty dangerious, I would suggest a different solution if at all possible. http://www.codeproject.com/useritems/SingleWebConfigFile.asp[^] Hope that helps. Ben
-
I wrote and article which describes how to change the web config file programmatically. I think if you follow my article you can created a domain user that you set up as the identity of your app pool that your web service runs under. Then you could change the web.config. NOTE when the web.config is change the application will restart. If you are talking about the web service changing a different web sites web.config that is pretty dangerious, I would suggest a different solution if at all possible. http://www.codeproject.com/useritems/SingleWebConfigFile.asp[^] Hope that helps. Ben
Hi Ihave looked at the article a while ago. Nice one, if I may say so, but it does not quite suite my needs. I just need to change an element in the connectionstringsettings to the connection string of my database. This connectionstring is unique per installation. If I change the security settings of the web.config file via Explorer then my code works well, and I can change the connection string as I please. I just need to change the security setting programmaticaly Regards