Wednesday, March 14, 2012

Creating a Sandboxed-compatible Visual Web Part

One of the things about installing the SharePoint Power Tools from the Visual Studio Gallery (http://visualstudiogallery.msdn.microsoft.com/8e602a8c-6714-4549-9e95-f3700344b0d9/) is that it states that you can now create a Sandboxed-compatible Visual Web Part, however, it provides no direction on how to accomplish directly from the Visual Studio Gallery site.

If you have created Visual Web Parts in the past, you probably know that the Visual Web Part project is offered directly as a SharePoint Project Template, therefore, when you look for the Sandboxed-compatible Visual Web Part Project Template, you will not find one.

Instead, the Sandboxed-compatible Visual Web Part ships as an Item Template instead.  This means that you have to create an Empty SharePoint Project as a Sandboxed Solution and then add a Visual Web Part (Sandboxed) to the solution.

It would have been much nicer if Microsoft had directly shipped a Sandboxed Visual Web Part as a Project Template, but it is what it is...

Here are the steps to create a Sandboxed-compatible Visual Web Part for those that are interested:
http://msdn.microsoft.com/en-us/hh181497

If you want to save some time and you also have a copy of Visual Studio 2012 on your machine, you can optionally follow these steps to get it to work in Visual Studio 2010 as well:  http://samirvaidya.blogspot.com/2012/07/creating-visual-web-part-project-as.html


No comments:

Post a Comment