Wednesday, May 30, 2007

Avoiding IIS Reset

Both in SharePoint development and CRM development, IISReset is needed sometimes to release fileholds. For instance, when developing callouts in MS CRM, the callout.config file will be blocked (by w3wp-crmapppool) as soon as a callout has been run.

The biggest problem with IISReset (or shuting the IIS down, compiling, restarting it) is that the entire application will be "just-in-time-compiled" each time, taking huge amounts of time especially when developing on virtual pc:s with only 1 GB (or less) of memory.

The workaround for this is to recycle the application pool for the IIS-website instead of restarting the entire IIS.

The easiest way of doing this is to right-click on the applicationpool and the choose "recycle".

This can be scripted (as described on Patrick Tissegheims blog) by using the script:

cscript c:\windows\system32\iisapp.vbs /a "SharePointDefaultAppPool" /r

Or as Patrick also mentions, there is a good tool for doing this, that can be found here:

So, that might easy your troubles, and save you some time.

If you are compiling on the server, my suggestion is to add the script to the pre build events in the project.

Gustaf Westerlund
CRM and SharePoint Consultant

Humandata AB

1 comment:

  1. The recycle of the ISS Application pool worked for my issue. I am developing in CRM using c# workflows and i was having to wait or reset IIs everytime I debugged the code! You are a star!