views:

1339

answers:

10

I need to edit the web.config file on a live Sharepoint environment, but I'm unsure what will happen if I do (I want to output custom errors).

Will this cause the IIS6 worker process to recycle?

Will active users lose their session state because of this?

Or can I safely edit the file?

+3  A: 

I believe this resets the application and user's will lose session state.

RyanFetz
A: 

It will make the application restart.

Kristian
+2  A: 

The app pool recycles and as such session state is lost.

SteveCl
+2  A: 

Yes, the AppPool will recycle and session state will be lost.

JacquesB
+16  A: 

The application pool will restart and session state will be lost. Imagine each ASP.NET application (as defined in IIS) is a program on the desktop. Saving web.config will do something similar to closing the program and reopening it.

Dan Goldstein
+11  A: 
  1. Yes. It will be recycled.
  2. Yes. They will lose their session.
  3. Yes. You can safely edit the file. I suggest you to read this MSDN article : Working with web.config Files in Windows SharePoint Services
Pascal Paradis
A very useful MSDN article. Thank you!
willem
+1  A: 

If you have any thoughts of editing the web config, please look into the SPWebConfigModification class.

+1  A: 

As already mentioned by some people: the application pool of the site in IIS will restart (this typically takes a couple of seconds). As a result the next page request(s) will be slower (since nothing will be cached anymore). Also the session state of the users will be lost; BUT in WSS session state is not used by default, in MOSS it is used by InfoPath Form Services. So it could be that you don't have big issues related to losing session state.

On the other side; to overcome those issues: what is typically done is to create a SharePoint Solution (WSP) that deploys and starts a Timer Job to make the changes to the web.config from code (using the SPWebConfigModification class of the Object Model). The nice thing is that you can schedule the execution of the change, so your users won't notice it.

Jan Tielens
A: 

Also if Session state is configured as out-of-process (database or service) then recycling the app pool won't lose any session state. This is as true for Sharepoint as it is for vanilla ASP.Net.

piers7
A: 

Concur with all of the above, I'd also like to point out that a backup (just a quick file copy even) of any manually edited web.config file is handy in case you screw up a quotation mark somewhere and break your website :-)

tekiegreg