Friday, 31 July 2015

Could not load the assembly 'Microsoft.SharePoint,Version=’ error when moving sites from Office 365 SharePoint Online to On Premise SharePoint 2013

Recently one of my clients who were using Office 365 SharePoint Online wanted to have a backup of their sites in their on-premise SharePoint environment. I used a leading SharePoint migration tool and was able to back up the sites to on premise SharePoint. But when trying to open a site or a document library I ran into the error “Could not load the assembly 'Microsoft.SharePoint,Version=’”

The issue happened because Office 365 SharePoint Online is has been updated to version 16 of SharePoint DLL while the on-premise SharePoint 2013 server had version 15 of the DLL. All the pages for sites, libraries and lists were pointing to the version 16 of the DLL.

 If it was single page a quick fix would have been to open the page in SharePoint Designer and change the version of DLL to 15. But since there were many sites and sub sites with lots of libraries and list I wrote a PowerShell script(courtesy to create new views for all lists and libraries and make them as default views. As the new view pages are referencing version 15 of Sharepoint the sites and libraries sprang back to life.