Showing posts with label wsp. Show all posts
Showing posts with label wsp. Show all posts

Friday 19 November 2010

Deploying a Sandbox solution

Problem: I created several wsp packages, unfortunately 1 of the solution projects was marked as a Sandbox solution when the project was created in Visual Studio 2010.  The lookup lists are not deploying correctly in the sandbox solution because I deployed the solution at farm level.

Initial Hypothesis: I notice my lists had strange behaviour.  I check my deployment and 1 of the solutions had not been deployed.  When I deployed the wsp using Powershell (PS> Install-SPSolution ...) it did not error so I had presumed it had installed correctly.  Using PowerShell (PS) I could see the solution holding the list wasn't installed. PS> Get-Solution
Resolution: Retract the solution and remove it from the farm.  Deploy the solution to the Site Collection's solutions and enable the feature/s.  Powershell Commands:
PS> Add-SPUserSolution -LiteralPath D:\packages\.Lists.wsp -Site http://demo.dev

PS> Install-SPUserSolution –Identity Lists.wsp -Site http://demo.dev
PS> Enable-SPFeature –Identity Feature_GeneralLists –url http://demo.dev/

Tip: Update 10 Dec 2010 - If you remove a solution (this also applies to sandbox solutions) (including deactivating the associated features), if the feature deploys content types or site columns, you will need to do an IISreset if you want the content types and site columns removed from the Site Collection (alernatively restart the Web Application so the whole farm is not reset).

Post on deploying fasm wsp's.

Wednesday 17 November 2010

Deploying packages into production using PowerShell

Problem: Developers build solutions and features for SharePoint 2010 using Visual Studio 2010 (VS), the farm wsp's need to be deployed in UAT, pre-production, production, CI potentially etc.  You don't have VS so you can use stsadm or Powershell.

Initial Hypothesis: This is a walk-thru on deploying your solutions and features in SharePoint 2010.  The main areas are:
  1. creating solution files (wsp's);
  2. moving them to the target environment;
  3. adding the various solutions and features at the appropriate level in your farm (features have 4 steps to get into production namely:
    • Add Solution,
    • Install Solution,
    • Install Feature and
    • Activate Feature.
Resolution:

1.> Create wsp's
1.1> Using VS2010, put the project into "Release" mode
1.2.> Next create the package using VS
2.> Copy the wsp located in the bin\Release directory of your VS solution to the farm where CA is hosted.
3.> Add solutions and activate features.
PS> Add-SPSolution D:\Packages\Demo.wsp
PS> Install-SPSolution –Identity Demo.wsp -GACDeployment
PS> Install-SPFeature demo_feature1 -force
PS> Enable-SPFeature –Identity demo_feature1 –url http://demo.dev/sites/demo
Tip: The feature scope requires different parameters.  For example if the feature above ( ) was scoped at Site (Site collection) level, the cmd would be: PS> Install-SPSolution –Identity Demo.wsp -GACDeployment –WebApplication http://demo.dev/
Scoped as web application level
PS>Install-SPSolution –Identity Demo-WepAppScope.wsp -GACDeployment –WebApplication http://demo.dev/sites/demo
Remove a web or site scoped solution
PS> Disable-SPFeature –Identity demo_feature1 –url http://demo.dev/sites/demo
PS> UnInstall-SPFeature demo_feature1 -force
PS> UnInstall-SPSolution –Identity Demo.wsp -GACDeployment
PS> Remove-SPSolution Demo.wsp
Cmd to add the SharePoint snapin, allowing the administration to manage SharePoint
PS> Add-PSSnapin Microsoft.SharePoint.PowerShell

Post on deploying Sandbox solutions.

Update: 27 Feb 2013.  The Install-SPFeature is only used for manual install i.e. not with wsp deployments but when you manually copy the feature files to each WFE.  You can keep the step as it has no negetive impact but it is not required.

Update: 20 May 2013.  This just bit me again.  I have an SP Timer Job scoped to WebApplication, by default when the solution/wsp is deployed, the feature receiver is activate automatically on ALL web applications (including MySites).  Change the Feature xml to include the attribute ActivateOnDefault="FALSE".

Read More:
http://sppowershell.com/2010/06/25/provisioning-sharepoint-2010-with-powershell/
http://msdn.microsoft.com/en-us/library/ms442691.aspx
http://stsadm.blogspot.com/2010/06/deploying-sharepoint-2010-solution.html
http://patrickboom.wordpress.com/2010/05/31/using-powershell-to-deploy-sharepoint-solutions-wsp-2/
http://dotnet.sys-con.com/node/1208275

Friday 1 October 2010

Save site as template link missing in site settings

Problem: You want to create an WSP for your site however, the "Save site as template" link is missing from the "Site Settings" page as shown below.
Hypothesis: Deactivate the Publishing features namely: Manage Site features > Sharepoint Server Publishing & Site Collection features > SharePoint Server Publishing Infrastructure.   You know have the ability to create site templates i.e. wsp files.  The problem is you don't have your publishing infrastructure.

Resolution: If publishing is enabled on your site, craft a url so you can create the wsp file.  Url is http://demo/_layouts/savetmpl.aspx

Tip:  You can only include up to 50 MB of contentin SP2010