1

How do I migrate Sharepoint Visual Web Part from Sharepoint 2010 to Sharepoint 2013.

I know I should migrate all list, and whats more. How upgrade the C# code to work with Sharepoint 2013. Please help.

1 Answer 1

1

I was able to get my solution upgraded from a 2010 project to 2013 using the following. Note that this will update your solution to use the new 2013 API. It is possible to update just the project file but still run in 2010 mode.

First edit your .csproj file (for c#).

Modify the target framework to this: <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>

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

Update references

Reload the project and update your referenced assemblies. If you haven't specified a specific version they should already be referencing the v15 (SharePoint 2013) assemblies.

Do a find replace for 14.0.0.0 to 15.0.0.0. This updates any references on your pages, layouts, and master pages to the v15 assemblies.

Change calls

Change any calls to SPUtility.GetGenericSetupPath() to SPUtility.GetVersionedGenericSetupPath()

Check each file to do a check for any hive references. You'll need to add a /15/ to these. EG: _layouts/ to _layouts/15/

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

Clean up

Finally do a compile clean up any missed items. Deploy your solution and make sure to test thoroughly.


Also Along with the above solution check out this link

and also this link which has a nice powershell script that fixes the target framework and server versions

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.