- Copy that solution from SharePoint 2010 Visual Studio folder to your SWharePoint 2013 file system .
- Open with Microsoft visual studio 2012.
- After opening it u will get this screen, because in previous solution we had given url of sharepoint 2010 site .
- Click on ok.
- Then you will get migration report close that report .
- And for solving above issue, change url of this solution give url of your Sharepoint 2013 site.
- Then save And deploy, Check your webpart in that site.
When you will migrate visual webpart so you may face some problem:
- Because while upgrading solution it gave you error some project item such as visual webpart may not upgrade correctly .
- So when you will go for the migration of visual webpart all the steps will be the same.
But some points where we need to focus in sp2013 are:
- .NET framework should be 4.5
- In the Reference properties version should be 15.0
- in the csproj file. In the SP 2013 project there is a <TargetOfficeVersion>15.0</TargetOfficeVersion> property that was not present in the SP 2010 project.
- These three changes will happen automatically by upgrading solution and if not please do these changes manually.
- So after checking these changes right click on solution and deploy it .
- When you try to open your site will get this error msg.
- For resolving it go to visual webpart .cs file and open it
- Add this /15 in .cs file, now save it,and deploy it.
- Your visual webpart will be working fine.