Question

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.

Was it helpful?

Solution

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/

OTHER TIPS

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.

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top