From the Farm to the Sandbox for SP 2010
By Eric Overfield
Dowload the entire Package Now
From the Farm to the Sandbox for SharePoint 2010
From the farm to the Sandbox project focuses on the process that one may go through when tasked with the job of taking a Visual Studio 2010 SharePoint 2010 project that was geared towards a farm and converting that to work within the constraints of a sandbox
solution. This project contains two similar VS 2010 projects that produce the exact same output to the end user, but much of the internals are vastly different as a developer is provided very different guidelines and constraints when creating a SharePoint
solution for farms and SharePoint solutions for a sandbox.
The seedling for the project was planted a while back when I was asked to take a solution for SharePoint that was built around a farmed solution using standard coding practiced for working with and now make it work within the confines of a sandbox. Sure,
sandboxed solutions are well documented right? It seemed that as one project was fixed, two new ones showed up. Therefore for my own sake I ended up building two similar solutions in Visual Studio that had the same basic structure. This included the need to
- Custom Fields
- Custom Content Type based off the Custom Fields
- Custom List Definition based off the Custom Content Type
- Custom List Instance based off the Custom List Definition
- Standard Modules including a Style Library Module that held assets including css, js, xslt, etc.
- Web part that utilized the List Instance and Module assets including the xslt style sheet
- A Feature that verified all module assets were checked in after Activation and the all feature assets (modules and lists) were properly removed.
The solution built for the farm handles these processes using techniques that are simple, clean and straight-forward. The solution built for the sandbox attempts to accomplish the same exact goals, but because of limitations and constraints of the sandbox,
much had to be re-worked.
The assets in the modules are exactly the same within both projects, but have different locations based on compromises. The web part itself provides a simple example of how to take list data and present it using a custom XSLT style sheet. I commented some
of the code and provided links and references. The suggested purpose of this project is to open both solutions side by side to see how development is different between the farm and the sandbox. Instead of providing a long document explaining these two solutions
I will be creating a series of articles on common differences between farm solutions and sandbox solutions and how I have found a way through.