Subscribe:

Labels

Friday, August 19, 2011

difference B/W Sandboxed solutions and Farm solutions


Sandboxed solutions:
Run in a secure, monitored process. Sandboxed solutions can be deployed without requiring SharePoint administrative privileges. If you choose a sandboxed solution, you can only use project item types that are valid in sandboxed solutions.
Sandboxed solutions are deployed to the database. This means that no files within the sandboxed solution will ever touch the file system of the server. Even dlls, xml files and aspx pages will be deployed to the database.
Sandboxed solutions, which are hosted in the SharePoint user code solution worker process (SPUCWorkerProcess.exe), run code that can only affect the site collection of the solution. Because sandboxed solutions do not run in the IIS worker process, neither the IIS application pool nor the IIS server must restart. Visual Studio attaches the debugger to the SPUCWorkerProcess process that the SPUserCodeV4 service in SharePoint automatically triggers and controls. It is not necessary for the SPUCWorkerProcess process to recycle to load the latest version of the solution.
By using sandbox solution we can deploy webparts,event receivers,feature receivers,Custom microsoft designer workflows activities,microsoft infopath business logics.It's cannot connect to resources that are not located on local server and can't access database as well as resources in different sitecollections.It is monitored & limited by quotas set by farm administrator.
who can deploy sandbox solution:If the solution contains assembly than only sitecollection administrator deploy it and if the solution does not contains assembly than a user who has full control on root of sitecollection deploy it

Farm solutions:
Farm solutions, which are hosted in the IIS worker process (W3WP.exe), run code that can affect the whole farm. When you debug a SharePoint project whose Sandboxed Solution property is set to "farm solution," the system's IIS application pool recycles before SharePoint retracts or deploys the feature so as to release any files locked by the IIS worker process. Only the IIS application pool serving the SharePoint project's site URL is recycled.
If Code requirements to run at the Web Application of Farm Level or talk with multiple site collection, in that case we should  go for Farm Solution
The visually difference between a sandboxed and a farm solution in Visual Studio 2010 are:
    The property Sandboxed Solution (Project properties): true for sandboxed, false for farm solution
    AssemblyInfo.cs: [assembly: AllowPartiallyTrustedCallers()] is present in a sandboxed solution, not in a farm solution.

No comments:

Post a Comment