Change Web.config value programatically

M

mg

How can I change the value of "timeout" in Web.config

<sessionState timeout="20" />

in one deployed app (project A) from a method call in a
WebForm (C#) that's running in another deployed app
(project B) on the same server.
 
P

Paul Glavich

This is generally not recommended, however, you could assign specific
read/write rights (ACL) to the user you have assigned as the user context in
project B. If you simply have the generic aspnet user defined for the app,
then you would be giving read/write access to the generic ASPNET user which
would allow anyone running under that user to modify that file, which is not
a good idea. Also bear in mind that each time that file is modified, either
manually or programmatically, that AppDomain for Project A will be
restarted, and any users on the site at that time would probably be booted
off or at least have to re-initiate the browser session.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,126
Messages
2,570,750
Members
47,308
Latest member
TorriLangr

Latest Threads

Top