.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Deploying sandboxed solution

Posted By:      Posted Date: September 15, 2010    Points: 0   Category :SharePoint
When I am deploying my sandboxed solution with Power Shell it deploys globally as full trust and not as sandboxed (there is nothing in the solution gallery). Here is my script: ADD-SPSolution -LiteralPath $wspPath Install-SPsolution -Identity $SolutionId -Force:$true -GACDeployment:$true -Local:$true -WebApplication $UrlSiteCollection Enable-SPfeature -Identity $SiteCollectionItemsFeature -Force:$true -URL $UrlSiteCollection The solution is deployed as sandboxed from Visual Studio, but not from this script. Am I missing some option on Install-SPSolution?

View Complete Post

More Related Resource Links

Deploying and Using jQuery with a SharePoint 2010 Sandboxed Solution

If you're an avid reader of this blog, you probably now that I'm quite a big fan of the jQuery Javascript library, especially in combination with SharePoint sites. For a while I've been trying to find a mechanism to deploy jQuery and add a reference to it on all SharePoint pages of a site, by just using a Sandboxed Solution. The first part, deploying the jQuery file, is really easy; this can be done in a Module in a SharePoint project. The second part was more of a challenge; making sure the jQuery file got referenced in all pages of a SharePoint site. My initial thought was to do this by using the AdditionalPageHead Delegate control, but it's not possible in a Sandboxed Solution (you need to deploy the .ASCX to the SharePoint root). My second thought was to use the new ScriptSrc attribute you can use in a CustomAction (I wrote about this attribute some time ago). But initially I was under the impression that the ScriptSrc attribute could only target Javascript files loaded from the SharePoint Root (the \LAYOUTS) folder, resulting in a no-go for a Sandboxed Solution as well. Daniel McPherson stumbled upon this issue as well, but neatly solved it using Javascript to add the reference dynamically. But apparently you can make use of the ScriptSrc attribute to reference files from the Virtual File System (e.g. a Document Library in a site) as well! (thank you Frederic Dobon for men

SharePoint's Sandbox: Developing, Deploying and Monitoring Sandboxed Solutions in SharePoint 2010


The challenge in SharePoint development has always been the balance between creating and deploying solutions that you can trust not to damage or impair a SharePoint farm. A new feature in SharePoint 2010, called Sandboxed Solutions, enables farm administrators to feel comfortable that the SharePoint farm is safe, gives site collection administrators the authority to manage applications in their site collection, and provides developers with the flexibility to create solutions they know will be deployed in a safe and rapid manner.

Paul Stubbs

MSDN Magazine November 2009

Error When Deploying Multiple Projects in a Solution

We have a solution with 16 projects, where all but 3 are Sharepoint 2010 projects. When we deploy the projects in VS2010 individually, everything is fine, but when we deploy the solution (right-click, deploy), we experience one of two problems: 1. Not all projects get deployed, some just give the following message: "Deployment was not performed for this project because it is a dependent project." 2. Some of the projects (currently always the same three Sharepoint2010 projects) give the following error during the "Recycle IIS Application Pool" step: "Error occurred in deployment step 'Recycle IIS Application Pool': The open operation did not complete within the allotted timeout of 00:01:00. The time allotted to this operation may have been a portion of a longer timeout." We don't have any dependencies set up in the projects except for the ones which are automatically created when we add project references. If we do two subsequent solution deployments, the first one will suffer from issue 1 and the second from issue 2 as well. When issue 2 happens, the faulty projects can't even be deployed individually until VS2010 has been restarted.   A Google search has revealed nothing at all. We're at a loss and it's getting to be very frustrating for the entire team. Any help would be appreciated.   Thanks, Bjoern

Deploying a custom theme as a farm solution

Hello,   I am a beginner to Visual Studio 2010 + Sharepoint 2010 - I have created a custom theme and would like to deploy it to my dev Sharepoint farm as a solution.  I've added the "Sharepoint mapped folder.." (..TEMPLATE\GLOBAL\Lists\themes) and added my thmx to that folder in the project.  When the solution is deployed to my dev farm the custom theme gets added to the 14 hive \TEMPLATE\GLOBAL\Lists\themes folder but when a new site is created the theme is not available from Site Settings->Site Theme or in the Theme Gallery.  What am I missing here?

Why sandboxed solution cannot load class?

Let's say I have a sandboxed web part with GridView. GridView has sortable columns. I need to store field name and sort order in the viewState. I add two properties to the web part (user control) class:         private string OrderByFieldName         {             get             {                 object o = ViewState["OrderByFieldName"];                 if (o == null)                     return "EmploymentStartDate";                 else                     return o as string;             }             set             {                 V

Is UpdatePanel supported in sandboxed solution?

I have never seen direct answer for this - is Microsoft AJAX (scriptmanager, updatepanel, AJAX control kit, etc) supported in sandboxed solution? If I simply add UpdatePanel into a sandboxed visual web part I get an error saying that script manager is missing. I can add script manager to the control list from code-behind and runtime error goes away, but page does full postback. Is it supposed to work or not? -Stan

Deploying A Solution Issue

I am trying to create a column whereby i can generate a Unique ID for my documents. I have downloaded and installed the UniqueColumnPolicy.wsp from http://blogs.salmanghani.info/?p=570 and i can confirm that in the Central Admin Site under Solution Management the solution has been deployed globally, but i dont see the solution in the List Settings where the article says it should be??? Has anyone any ideas on this? Have i missed a step somewhere?

EnsureUser in sandboxed solution (AllowUnsafeUpdates)


I need to get user name (first and last name) for the given login name (MyDomain\TestUser).  EnsureUser does that:

SPUser responsiblePerson = web.EnsureUser (loginName);               
string userName = responsiblePerson.Name;

I am not sure if that is the rigth way of getting user name, because as far as I understand it adds a user to the internal user list and the collection of users.

This is probably why it fails in sandbox solution with dreadful exception below. It does not fail in all cases, though.


Updates are currently disallowed on GET requests. To allow updates on a GET, set the 'AllowUnsafeUpdates' property on SPWeb.
Server stack trace: at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx) at Microsoft.SharePoint.Library.SPRequest.UpdateMembers(String bstrUrl, UInt32 dwObjectType, String bstrObjId, Guid& pguidScopeId, Int32 lGroupID, Int32 lGroupOwnerId, Object& pvarArrayAdd, Object& pvarArrayAddIds, Object& pvarArrayLoginsRemove, Object& pvarArrayIdsRemove, Boolean bRemoveFromCurrentScopeOnly, Boolean bSendEmail) at Microsoft.SharePoint.SPUserCollection.UpdateMembers(Object objUpdateInfo, Object objAddIds, Object objRemoveLogins, Object objRemoveIds, Boolean fSendEmail) at Microsoft.SharePoin

Error messages when deploying SSAS 2008 solution


I'm working on an AS 2008 project using VS2008. The relational database for the data source is SQL Sever 2008 R2 CTP (n.b correction from original post), and so is the target server I am trying to deploy to. When I try to deploy the solution the following errors are returned:

Error 5 Internal error: Invalid enumeration value. Please call customer support! is not a valid value for this element.  0 0 

Error 6 An error occurred while parsing the 'StorageMode' element at line 1, column 11865 ('http://schemas.microsoft.com/analysisservices/2003/engine' namespace) under Load/ObjectDefinition/Dimension/StorageMode.  0 0 

Error 7 Errors in the metadata manager. An error occurred when instantiating a metadata object from the file, '\\?\C:\Program Files\Microsoft SQL Server\MSAS10_50.MSSQLSERVER\OLAP\Data\AMS Analysis Services 2008.0.db\Dim Date.19.dim.xml'.  0 0 

I'm afraid I'm a bit stumped by these. Is it something to do with the fact that the target Analysis Services server is running R2? If so what can I do to deploy to that box?


Sandboxed Solution Issue

I have an issue in using Sandboxed Solution on SharePoint 2010 Enterprise Svr. I have created & deployed a webpart as a Sandboxed solution, when i try to add webpart in page i'm getting "The sandboxed code execution request was refused because the Sandboxed Code Host Service was too busy to handle the request"

I googled this error and tried below three solutions, but it did not help...

1. Started "Microsoft SharePoint Foundation Sandboxed Code Service" service from "Manage services on server" option
2. $acl = Get-Acl HKLM:\System\CurrentControlSet\Control\ComputerName 
$person = [System.Security.Principal.NTAccount]"Users" 
$access = [System.Security.AccessControl.RegistryRights]::FullControl 
$inheritance = [System.Security.AccessControl.InheritanceFlags]"ContainerInherit, ObjectInherit" 
$propagation = [System.Security.AccessControl.PropagationFlags]::None 
$type = [System.Security.AccessControl.AccessControlType]::Allow 
$rule = New-Object System.Security.AccessControl.RegistryAccessRule($person, $access, $inheritance, $propagation, $type) 
Set-Acl HKLM:\System\CurrentControlSe

Deploying a .thmx theme as a farm solution


Hello everybody,

I am another beginner to Visual Studio 2010 + SP 2010 and I have created:

1.     A custom theme (.thmx file)

2.     A feature to deploy it to my SharePoint farm as a solution, and this is how the FeatureActivated method look like:

        public override void FeatureActivated(SPFeatureReceiverProperties properties)

            SPWeb currentWeb = (SPWeb)properties.Feature.Parent;

            currentWeb.AllowUnsafeUpdates = true;

            currentWeb.SiteLogoUrl = "**url to logo1**";


            foreach (ThmxTheme theme2 in ThmxTheme.GetManagedThemes(currentWeb.Site))

Content Editor text format functionality lost after deploying branding solution package


I've got two identical SharePoint 2010 servers.  One is a dev box and one is production.  We've got a branding solution package.  After deploying the package on the production server, when I go into edit a page, the text format functionality in the content editor works fine, i.e. I can change font, font size, font color, etc.  However, when I deploy the solution package on the dev server and then attempt to edit a page, the text format functionality is disabled/broken.  I can utilize bold, underline, or italicize but cannot change font, font color, font size, etc. 

I've copied a site collection from my production site (which works perfectly) over to the dev site with the same results, meaning once on the dev box, the copied site collection no longer has editing functionalilty in the content editor. Permissions are set the same on both boxes and as mentioned, editing works fine until deployment of the solution package on the dev box.   Any help would be greatly appreciated. 

Could Visual Studio installed on my Dev box cause this?


Failed to create receiver object when deploying solution



I get the following error

Failed to create receiver object from assembly "MySolution, Version=, Culture=neutral, PublicKeyToken=d398c9a30aa5e960", class "MySolution.Features.MyFeature.MyEventReceiver" for feature "MySolution_MyFeature" (ID: d159bf93-828b-44d6-a449-b1fe4b8c6066).: System.ArgumentNullException: Value cannot be null.
Parameter name: type
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()

when deploying my solution using stsadm.

.\stsadm -o deploysolution -name MySolution.wsp -allowgacdeployment -immediate
.\stsadm -o execadmsvcjobs

If I redeploy it using the same stsadm commands again it works.

The feature event receiver is in a dll that is deployed in the GAC in the same solution.

This has worked before and I wonder if there is some way I can troubleshoot this



Help with deploying a solution


I created a Visual Web Part package and I need to deploy it to the server.

I copied the .wsp file to the server and loaded the solution in SP 2010.

It won't let me activate the solution.

Does anyone have a link to install the wsp correctly?


I'm guess I need to add it to the SafeControls section so I can add it. Not sure how to do that tho.,

Error debugging sandboxed solution: The sandboxed code execution request was refused because the San



I'm trying to deploy a sandboxed solution but I don't succeed.
I created an empty sharepoint project, added a (regular) webpart to it and that's it. Didn't add any code of my own to the project.

Then I hit F5 to deploy it to my sharepoint server (visual studio and sharepoint running on the same machine)

First it gives me an attach security warning, where I hit "attach"
Then a message about scrip debugging disabled where I click ok to enable it.

Then my sharepoint site opens, I log in and it displays my default team site page.
I go edit the page and add my custom web part, and when I click add I get a loading window that seems to hang for a while and then an error:

The sandboxed code execution request was refused because the Sandboxed Code Host Service was too busy to handle the request

I searched google and here on the forums, found several topics describing the same.
I checked and in Central Admin the service "Microsoft SharePoint Foundation Sandboxed Code Service " is started
I also tried to execute the powershell script (even though the server is not running DC)

All to no avail.
Am I missing something here, why do I get this error ?

Deploying Branding Solutions for SharePoint 2010 Sites Using Sandboxed Solutions

Learn to create sandbox-compatible branding solutions using custom master pages, CSS files, and images that can be deployed to SharePoint 2010 farms.

Sample: Deploying Branding Solutions for SharePoint 2010 Sites Using Sandboxed Solutions

Explore the code as you learn to create sandbox-compatible branding solutions using custom master pages, CSS files, and images that can be deployed to SharePoint 2010 farms.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend