How to update UDF assemblies during development

In previous posts, I showed quite a few examples of how to create UDFs. In a recent email in one of our distribution lists, somebody asked how to update UDF dlls in Excel Services.

The issue is that as long as the server is up, the UDF assemblies have a lock on them, making it impossible to update them on disk.

On the distribution list, somebody asked if it's true that the only way to update them is to reboot the server. While that would work, there's no need to take such drastic action. There are three other ways to do this.

First way (good):

Calling IISRESET will restart the entire IIS server, unlocking the file and making it writable again.

This works fine and is easy to do, however, it also takes down the rest of the server.

Second way (better):

The second only takes down Excel Services - less "destructive" measure. To do that, open the IIS console and open the "Application Pools" node. Under it you should see a node called "SharedServices1". Right click that and choose recycle. The UDF DLL should now be unlocked and usable.

Third way (best):

You can use the IISAPP script to recycle the app pool. To do that, in the command prompt (or from start/run) type:

IISAPP /a SharedServices1 /r