About Me

My photo
a Dynamic and Energetic guy.....

Tuesday, July 17, 2012

Create a SandBox Solution in SharePoint 2010

1. Open VS SharePoint project and Add a WebPart (we can't add a "Visual WebPart" for a SandBox Solution)






2. Add a simple code within "CreateChildControls" method
build the solution, then "Package" the solution to create a ".wsp" file

3. Go to "Site Settings" --> "Solutions"

4. Upload the "Solution"  (.wsp file)
but "Activate" button is disabled :(

5. So go to Central Administration --> "Services on server"
Start "Microsoft SharePoint Foundation Sandboxed Code Service"


6.Now "Activate" the solution

7. Verify whether the created item is listed under "WebParts" section (Site settings)
8. Add our WebPart to a page
 
9. Deactivate "Solution" when task is done / no longer needed

10. If any case start "SharePoint 2010 User Code Host" service


If can't find the error, set CALLSTACK =TRUE in related web.config file and click "Activate" button.





No comments:

My Masters