Converting a SharePoint 2010 Solution to 2013 and Visual Studio 2012

I am trying to convert a SharePoint 2010 solution (custom web parts, content types, lists, event receivers, etc.) developed in Visual Studio 2010 to SharePoint 2013 and Visual Studio 2012. When I open a project in VS 2012, it converts a couple project files, but won't compile due to link issues.

I copied the DLLs (mainly Microsoft.SharePoint ... although I also needed to copy the Microsoft.Office.SecureStoreService.dll file) that were causing problems from my 2010 server to 2013 server and fixing the references. However, the Microsoft.Office.SecureStoreService.dll file still gives me compiler errors requiring "Error 203". The type or namespace name "Office" does not exist in the namespace "Microsoft" (are you missing an assembly reference?) "When visual studio does not have a namespace issue and finds the SecureStoreProvider class inside it just fine.

I also tried changing the target framework from 3.5 to 4 and only see "Install other frameworks ..." in the target framework dropdown.

I'm sure others have dealt with this but were unable to create a correct google search term. I am relatively new to SharePoint in general and any help would be appreciated.

thank,

Mike

+3


source to share


1 answer


I was able to update my solution from 2010 to 2013 using the following. Note that this will update your solution to use the new 2013 API. You can only update the project file, but still run it in 2010 mode.

First edit the .csproj file (for C #).

Change the target structure as follows: <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>

Add this node for office version, I put mine directly below TargetFrameworkVersion tag <TargetOfficeVersion>15.0</TargetOfficeVersion>

Refresh links

Reload the project and update your referenced assemblies. If you didn't specify a specific version, they should already be referenced to v15 assemblies (SharePoint 2013).

Find a replacement for 14.0.0.0

on 15.0.0.0

. This updates any links to your pages, layouts and master pages to v15 assemblies.



Change calls

Change any calls SPUtility.GetGenericSetupPath()

toSPUtility.GetVersionedGenericSetupPath()

Check each file to check for hive references. You need to add / 15 / to them. EG: _layouts / to _layouts / 15 /

Open the package folder in visual studio, then update the properties of that package to use version 15.

Cleaning

Finally, compile any missing items. Deploy your solution and be sure to test it thoroughly.

+8


source







All Articles