0

I am trying to use a Visual Webpart in a sandbox solution. However every I deploy it: it gives me the following error:

Error 1 The deployment type "TemplateFile" of file "VisualWebPart1UserControl.ascx" in Project Item "VisualWebPart1" is not compatible with a Feature in a Sandboxed Solution.

I did some research and found out that Visual WP is not supported in Sandbox solutions. Is there anyway I can have Visual WP in a sandbox solution?

And is there any specific reason as to why Visual WP is not really supported in Sandbox solution.

Andres Morales
  • 155
  • 5
  • 15

3 Answers3

2

Use VS Sharepoint Power Tools. It has Visual Web Part item template for sandbox solutions. http://visualstudiogallery.msdn.microsoft.com/8e602a8c-6714-4549-9e95-f3700344b0d9/

Dmitry Kozlov
  • 486
  • 3
  • 5
0

You can deploy a solution directly onto your SharePoint Server farm, or you can deploy the solution into a sandbox. A sandbox is a restricted execution environment that enables programs to access only certain resources, and that keeps problems that occur in the sandbox from affecting the rest of the server environment. Solutions that you deploy into a sandbox, which are known as sandboxed solutions, cannot use certain computer and network resources, and cannot access content outside the site collection they are deployed in.

Normally, a Visual Web Part cannot be sandboxed, as it needs to work outside the sandbox in order to load the underlying user control for the Visual Web Part.

This is how to have a Visual WP in a sandbox solution: http://msdn.microsoft.com/en-us/office365trainingcourse_lab_2_1_topic3.aspx

sainiuc
  • 1,697
  • 11
  • 13
  • The SharePoint Power Tools as mentioned by @Dmitry Kozlov allows Visual Webpart to be deployed into a site. I installed it and it works fine. So, according to you Visual Webpart (Sandboxed) is not a "normal" webpart? – Andres Morales Nov 08 '12 at 14:05
0

Please follow this link

Restrictions on Sand boxed Solutions in SharePoint 2010

http://msdn.microsoft.com/en-us/library/gg615454.aspx)

it will provide you the detaisl about the limitation of Sandboxed solution.

RoManiac is correct, you can not deploy visual web part in Sanboxed solution as it contains user control. Mark as answer if it helps you.

Sigar Dave
  • 2,598
  • 1
  • 20
  • 42