none
How to upgrade a SP 2010 solution to 2013 and continue development with the new object model

    Question

  • I have been involved in the development of a fairly large SharePoint application. Our goal currently consists in migrating the application to SP 2013 and carrying on with the development using the SP 2013 features and object model. I have already successfully tried the following scenarios:

    - Install the 2010 solution wsp directly on SP 2013.
    - Import the wsp in VS 2012 rebuild and deploy it to a 2013 installation. 

    However, neither of the cases has the desired effect. In the second case I cannot modify the code anymore, since it appears only inside the imported dlls (although the version is correct, i.e. 4.0 instead of 3.5).

    Ideally, I would like to open the old solution with VS 2012 target the .NET 4.5 framework and reference the SharePoint 2013 dlls. However, the project properties only allow me to select .NET Framework 3.5 (hence even if I reference the new SP dll s, the build will fail, because these depend on other assemblies, such as mscorlib etc., whose version is defined automatically by the project target framework and cannot be tampered with.) 

    I have the feeling I am missing something here, but I do not know what. What is preventing my solution from targeting .NET 4.5 and is there any way to change this? I have already tried this with more than one SP 2010 solutions, (simple as well as more complicated), but so far no success.

    Many thanks for any help or hints on the issue.
    Monday, February 4, 2013 2:20 PM

Answers

  • Hi Johnny,

    If you are deploying sharepoint 2010 wsp in SP2013, the files will get deployed to 14 hive instead of 15 hive and the target framework would still refer to 3.5 instead of 4.5. so you need to make the below 2 changes

    1. Set the SharePointProductVersion to 15.0 instead of 14.0 in the manifest file for the Solution element

    2. Set the .net Framework target to 4.5 by changing the TargetOfficeVersion for the project files

    You can check the below posts on hot to do these things

    http://social.msdn.microsoft.com/Forums/en/sharepointdevpreview/thread/93bc1f0a-b84a-41df-9c13-2bdfa92a529f

    http://www.codeproject.com/Articles/522220/ConvertingplusmultipleplusSharePointplus2010pluspr

    hope this helps


    Raghavendra Shanbhag | Blog: www.SharePointColumn.com
    Please click "Propose As Answer " if a post solves your problem or "Vote As Helpful" if a post has been useful to you.
    Disclaimer: This posting is provided "AS IS" with no warranties.

    • Marked as answer by johnny_tz Wednesday, February 20, 2013 7:57 AM
    Wednesday, February 20, 2013 5:13 AM

All replies

  • Johnny,

    I am having kinda like same situation, but I am trying it by actually duplicating the project and opening it VS 2012 and changing the dlls and Framework.  I was able to point the framework to 4.5.

    First thing I would like you to check is to see if you have the 4.5 Framework Installed... If it is then it should be displayed in the drop down. Do you see it in the drop when you go the project properties????

    Tuesday, February 19, 2013 10:14 PM
  • Hi Johnny,

    If you are deploying sharepoint 2010 wsp in SP2013, the files will get deployed to 14 hive instead of 15 hive and the target framework would still refer to 3.5 instead of 4.5. so you need to make the below 2 changes

    1. Set the SharePointProductVersion to 15.0 instead of 14.0 in the manifest file for the Solution element

    2. Set the .net Framework target to 4.5 by changing the TargetOfficeVersion for the project files

    You can check the below posts on hot to do these things

    http://social.msdn.microsoft.com/Forums/en/sharepointdevpreview/thread/93bc1f0a-b84a-41df-9c13-2bdfa92a529f

    http://www.codeproject.com/Articles/522220/ConvertingplusmultipleplusSharePointplus2010pluspr

    hope this helps


    Raghavendra Shanbhag | Blog: www.SharePointColumn.com
    Please click "Propose As Answer " if a post solves your problem or "Vote As Helpful" if a post has been useful to you.
    Disclaimer: This posting is provided "AS IS" with no warranties.

    • Marked as answer by johnny_tz Wednesday, February 20, 2013 7:57 AM
    Wednesday, February 20, 2013 5:13 AM
  • Thanks to both SP2013Dev and Raghavendra for your replies.

    Yes the 4.5 Framework is installed.

    Setting the TargetOfficeVersion to 4.5 as Raghavendra suggested, was exactly what I was looking for. 

    Wednesday, February 20, 2013 7:57 AM