Thursday, February 21, 2013

Where are Assemblies in Sandboxed Solutions Deployed?

Hi All,

Sometime back I started working on SandBox Solutions. I came across many issues and situation in terms of restrictions and Resource Point Utilization.

When I tried creating a Visual WebPart then I neede PowerTool VS extensions inorder to make it work.
Hence I realized that in sandbox solution, we are not dealing with file system. It its not that way then where my assemblies reside.

Then came across a msdn article which enlightened me with following facts.

The assemblies in the sandboxed solution are included in the solution pkg i.e. ".wsp" file, and the pkg is deployed to the site collection's solution gallery.
When a sandbox solution is accessed for the first time i.e. when a user access the webpart from sandbox solution, any assembly in the solution is extracted from the pkg in the gallary and copied to the file system of the server that is handling the sandboxed request. The location is
c:\ProgramData\Microsoft\SharePoint\UCCache

The executable of this service is SPUCHostService.exe. The server that handles the sandboxed request is not necessarily the front-end web server that is handling the initial HTTP request.
The Microsoft SharePoint Foundation Sandboxed Code Service can be run on back-end application servers in the farm instead. Because the sandboxed user process (SPUCWorkerProcess.exe) cannot copy anything to the file system, the copying is done by theMicrosoft SharePoint Foundation Sandboxed Code Service.

The assemblies of a sandboxed solution do not stay in the file cache perpetually. When the user session that accessed the solution ends, the assemblies stay in the cache for only a short time, and they may be reloaded from there if another user session accesses them. Eventually, if they are not accessed, they are removed in accordance with a proprietary algorithm that takes into account how busy the server is and how much time has gone by since the assemblies were last accessed. If the sandboxed solution is used after that time, the assemblies are extracted again and copied to the UCCache.


No comments:

Post a Comment