Wednesday, April 2, 2014

Recycle Application Pool On SharePoint Deploy

Why recycle at all?

Normally you don’t need to. Recycling the application pool simply release the resources held by the current application pool stop the w3p process and start another one for the same application pool. Supposable it release memory created by memory leaks, but if you don’t have memory leak, like all applications are supposed to, this will just make your site perform slower when the recycle occurs. Here is some description and you can find more like this:

Why Visual Studio recycle IIS on deploy?

When you add solution to SharePoint you are basically adding a “wsp” package that contains in it all definitions and dll libraries that where compiled and bundled up in order for share point to use it. But the application pool process may already use a previous version of the dll libraries deployed with a previous version of the package and the recycle of the application pool clear all held instances and use the latest content delivered by the package. Also recycling iis pool before the deploy itself may help speed it up.
Here is some information on the deploy and release processes in SharePoint:
http://gokanx.wordpress.com/2013/10/24/release-distribution-process-on-sharepoint-gotchas/

Recycle app pool with code


The idea is really simple you pass SPApplicationPool instance find the server location, retrieve an instance of the DirectoryEntry and start the recycle process:

1 comment:

  1. I don’t waste my free time in watching movies except I go for to read posts on net and get updated from newest technologies. I am glad that I had the fortune to stumble across your blog. I like it! It is pretty worth enough for me.

    Custom Healthcare Website Design 2017 - Best Websites 4 Medical Professionals.

    ReplyDelete