Sitecore Experience Platform 9.0 rev. 171219 (9.0 Update-1) and Glass.Mapper 22.214.171.124
We have recently upgraded to Sitecore 9 Update 1 from Sitecore 8.1 Update 3. And then we upgraded the Glass.Mapper to it’s latest stable version 126.96.36.199 and started getting error “Method not found – Boolean PageMode.get_IsPageEditor()”, which appeared to be more stubborn than I initially thought it would be. Then I had thoughts on its compatibility with Sitecore 9, and could get enough evidence to believe that it should definitely work with SC 9. Compatibility Chart of Glass clearly shows that: Glass Compatibility Chart . And also, I have found blogs such as: https://sitecoresandbox.com/2017/11/08/glass-mapper-experience-editor-issue-with-sitecore-9/ and http://www.sitecorebear.com/glass-mapper-and-sitecore-9/, which shows Glass.Mappers previous beta version 188.8.131.528 works with SC 9.
Even after trying multiple stuffs such as checking all references, dll versions, uninstalling-reinstalling Glass.Mapper and debugging, this error didn’t disappear. But strangely, it worked with the latest Prerelease beta version 184.108.40.2069 without any efforts. But, we were more inclined towards using stable version rather than Beta ones.
Finally, Glass.Mapper’s latest stable version worked fine with SC9. Thanks to Mike Edwards for his prompt responses on the Slack channel.
So, if you are facing issues to get Glass.Mapper 220.127.116.11 working with SC 9, here are the quick checks:
- Check Sitecore.Kernel and System.Web.Mvc versions to be correct, even before installing Glass Mapper. Reason being these assemblies are used to determine which version of the Glass.Mapper assemblies should be referenced.
- If you have multiple projects where Glass is being referenced or installed, check for their versions, or better uninstall and re-install (especially if you have this upgraded Sitecore). If you have installed through Nuget, you can manage the Glass versions for all the projects by simply selecting “Manage NuGet Packages for Solution”, by right clicking on the solution.
- Once the Glass has been installed, make sure that Glass.Mapper.Sc should be referenced from lib/111 (packages/Glass.Mapper.Sc.Core/lib/111) and not lib/82 or any other. When I installed I noticed that, it by default refers this dll from lib/82, so I had to update it. You may check for other two Glass dlls too. “Glass.Mapper.Sc.Mvc” should be referenced from lib/Mvc52 and Glass.Mapper from lib/net45.
- If you are still getting the same error, delete the entire bin and obj folders from all of your projects in the solution, rebuild and deploy.
- It should be working by now, but for me I had to bounce the IIS to get it working after performing all the above steps.