Share and Enjoy !

Introduction to How to Migrate a SharePoint 2010 Solution to 2013

I recently had a need to migrate/port an existing SharePoint 2010 farm-based solution to work in SharePoint 2013.  The following sections describe some of the changes I had to account for to complete the migration.

To help provide context, the farm solution consisted of the following items:

  • 3 Site Collection-level Features
  • 1 Farm-level Feature
  • 4 “Admin” application pages
  • 2 Web Parts
  • 1 Custom List Definition and Instance (at the Site Collection-level)

Visual Studio 2012 Updates

In order to compile/build a project that originated from Visual Studio 2010, I had to install and configure “Microsoft Office Developer Tools for Visual Studio 2012” in order to open the projects in Visual Studio 2012.

The following link describes how to download and install “Microsoft Office Developer Tools for Visual Studio 2012”.

How to enable SharePoint 2013 Development Project Templates in Visual Studio 2012

Assembly Reference Updates

All .NET Framework references had to be updated to v4.0

The following SharePoint references had to be updated for SharePoint 2013.  This is not an exhaustive list of references, but shows the ones I had to update (and should serve as a reference for the most common ones).

Assembly Name

SharePoint 2010 Version / Runtime

Microsoft.BusinessData.dll14.0.0.0 / v2.0.50727
Path to SharePoint 2013 VersionC:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\

 

Microsoft.Office.Server.dll14.0.6114.5000
Path to SharePoint 2013 VersionC:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\

 

Microsoft.Office.Server.
Search.Connector.dll
14.0.0.0 / v2.0.50727
Path to SharePoint 2013 VersionC:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\

 

Microsoft.Office.Server.
Search.dll
14.0.0.0 / v2.0.50727
Path to SharePoint 2013 VersionC:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\

 

Microsoft.SharePoint.
ApplicationPages.Administration.dll
14.0.0.0 / v2.0.50727
Path to SharePoint 2013 VersionC:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\CONFIG\ADMINBIN\

 

Microsoft.SharePoint.
ApplicationPages.dll
14.0.6116.5000
Path to SharePoint 2013 VersionC:\inetpub\wwwroot\wss\VirtualDirectories\80\_app_bin\
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\CONFIG\BIN\

Microsoft.SharePoint.dll14.0.0.0 / v2.0.50727Path to SharePoint 2013 Version

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\

 

Microsoft.SharePoint.
Security.dll14.0.0.0 / v2.0.50727Path to SharePoint 2013 Version

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\

 

Microsoft.SharePoint.
WorkflowActions.dll14.0.6108.5000Path to SharePoint 2013 Version

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\

 

 

Note: If your build infrastructure does not have SharePoint 2013 installed, you may want to consider creating a “Common” folder to use for referencing a copy of all SharePoint 2013 assemblies…

Code Updates

Step One

All path references pointing to a location in the SharePoint Root have to be updated.  This includes the following base level paths.

Some Examples:

Control Templates

From:

~/_CONTROLTEMPLATES/{Your custom folder here}

To:

~/_CONTROLTEMPLATES/15/{Your custom folder here}

Images

From:

/_layouts/images/{Your custom folder here}

To:

/_layouts/15/images/{Your custom folder here}

Styles/CSS (example placement of solution-specific CSS)

From:

/_layouts/{Your custom folder here}/css

To:

/_layouts/15/{Your custom folder here}/css

JavaScript  (example placement of solution-specific JavaScript)

From:

/_layouts/{Your custom folder here}/scripts

To:

/_layouts/15/{Your custom folder here}/scripts

Step Two

Application page (.aspx) assembly references had to be updated to reflect the SharePoint 2013 versions.

From:

<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" 
Assembly="Microsoft.SharePoint, Version=14.0.0.0, 
Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

To:

<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" 
Assembly="Microsoft.SharePoint, Version=15.0.0.0, 
Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

Step Three

Since I had to switch references to a newer version of .NET Framework, I had to update some method calls.  This will definitely depend on the .NET Framework and SharePoint 2013 implementation details that you rely on.  Once you have been able to successfully open the existing Visual Studio 2010-based project in Visual Studio 2012, and have handled the items above, simply compiling/building the solution in Visual Studio 2012 should present you with a list of warnings/errors to deal with…

Examples:

  • “RegisterPluggableSecurityTrimmer” method on PluggableSecurityTrimmerManager now expects 4 parameters and not 3
  • “CreateCrawledProperty” method on Category now expects 3 parameters and not 4
  • Properties on a “Mapping” object now have to be explicitly set vs. set in a constructor

Conclusion

Hopefully, the content of this article will help you with your conversion to Visual Studio 2012.  There are likely other conversion issues to be aware of that are not captured here.

This is not meant to be an exhaustive list, but more of a guide to get you started on the conversion and off to a productive start.

What other things would you add to this list?  Leave your suggestions in the comments section below…

Share and Enjoy !

Related Content: