In SharePoint 2010 it is well known that features can be versioned and upgraded accordingly.
This is well described in the following MSDN documentation:
Surprisingly, upgrading features requires calling the SPFeature.Upgrade() method of any feature that need to be upgraded.
Chris O’Brien provides a set of tutorials that illustrate how to upgrade features in SharePoint and I recommend his posts
Chris also provide a nice tools (as well as a Powershell commandlet) to visually upgrade features.
It is less known that calling SPFeature.Upgrade() is not necessary (and not supported) in the Sandbox : when we upload a new solution package with a different name, but with the same solution Id, the features will automatically be upgraded.
To illustrate this, let’s create a Visual Studio 2010 Sandbox project called DemoUpgradeSandBox; add a web part to have a feature and set the feature version property to 1.0.0.0.
Deploy the solution with Visual Studio 2010 and make sure the solution package is deployed and activated to the solution gallery.
Now, let’s change our feature version number to 2.0.0.0
Open the feature Manifest :
Add the following Upgrade Action:
Add a feature Receiver, to handle the upgrade by code :
![]()
Uncomment the FeatureUpgrading() method :
Build the project, rebuild the package, rename the package on the file system :
In Visual Studio 2010 set a breakpoint in the FeatureUpgrading method(), and attach the project to the sandbox host process (SPUCWorkerProcess.exe) :
Upload the new package into the solution gallery; since the same solution Id is used, SharePoint will ask you to upgrade :
Click on upgrade and you will hit the breakpoint in Visual Studio :
Displaying custom list with multiple date fields in Calendar view in 2010
I am using SharePoint 2010. I have a list for tracking project progress. I have multiple date fields in that list and most of them are calculated fields. I need to show these dates in Calendar view, as calendar view requires start date and end date ,it seems an item from list can only be shown as calendar view based on only two date fields. I am wondering it is possible to show those multiple dates related to an item in a calendar? Any suggestion would be highly appreciated? OTB or Visual Studio. Thank you!!!
By: jonam on August 17, 2011
at 1:57 am
[...] Luca explains a different approach for upgrading features in his post: http://sergeluca.wordpress.com/2011/06/15/sharepoint-2010-upgrading-feature-with-versioning-is-easie… . This approach is only for Sandboxed Solutions. By renaming the WSP package before deploying, [...]
By: Feature Upgrading in SharePoint 2010: Part 2 – Upgrade Fields & Content Types using Declarative XML – Silverlight and .Net | Sjoukje Zaal on October 25, 2011
at 11:03 am
Is there a way to upgrade a sandboxed feature through visual studio or do you have to do it manually.
By: Reggie Rowlandson (@iamnotadouche) on December 28, 2011
at 8:33 pm