0
votes

Glass.Mapper.Sc has an assembly for each version of Sitecore.Kernel (located in the lib folder of the nuget package).

We are building a library which should be usable for different versions of Sitecore (7.2 and 8.1) and I would like not having to create a version of my library for each Sitecore version.

Is safe to just use the 7.2 version of Glass.Mapper.Sc for 8.1?

All we are doing is using basic Sitecore API which to my knowledge hasn't changed between 7.2 and 8.1.

2
Just did a quick test and it basically worked. Then decompiled the 8.1 and 7.2 assemblies and compared. There are some differences in the SitecoreFieldLinkMapper.cs and SitecoreFieldDateTimeMapper.cs which problably means these fields won't work correctly. Leading me to the conclusion that it's not safe to just use the 7.2 DLL versions for 8.1 - Mark Lowe

2 Answers

1
votes

I guess it will not work. Glassmapper for Sitecore 8 didn't work for Sitecore 8.1 Glass Mapper is using System.Web.Mvc.dll that was changed in version 8.1 (Mvc 5.2.3) and Glass Mapper used before Mvc version 5.1

Here is the related issue : https://github.com/mikeedwards83/Glass.Mapper/issues/183

0
votes

Glass mapper assemblies uses these dlls

  • Sitecore.Kernel.dll
  • System.Web.Mvc.dll

These assemblies are used to determine which version of the Glass.Mapper assemblies should be referenced, once you install it.

Glass.Mapper.Sc for Sitecore 7.2 needs diffrent assemblies than Glass.Mapper.Sc for Sitecore 8, So this will not work.