Sitecore 9.1 and Glass.Mapper.Sc

Today I have released Glass.Mapper.Sc support for Sitecore 9.1 (Release notes)!

You can now use Glass.Mapper.Sc with the latest and greatest version of Sitecore.

The new version can be installed using the normal nuget package. However If you are planning on using Package References instead of Package.Config please reader  theInstallation documentation.

Just for general interest I thought it would be interesting to detail the steps and changes I made to support Sitecore 9.1:

Nuget Changes:

  • Understand if traditional ASP.NET Web projects can support the new contentFiles definition in Nuget packages. This is part of the Package References changes and unfortunately ContentFiles are not supported in ASP.NET Web project. This means that for those who want to use Package References with V5 they will have to manually add the files that are normally added by the Nuget package.

Code Changes:

  • Update preprocessor directives in the code to support 9.1. This includes creating a new Sitecore Version Abstractions class which will contain all preprocessor directives.  I will eventually refractor all the code so that all preprocessor directives are in this class. 
  • Update all projects configurations to support .NET Version 4.7.1. The target framework version actually has to be dynamically defined based on the version of Sitecore being compiled. This is achieved using the Configuration.Proj file.
  • Added references to the different DLLs used by Sitecore 9.1. This is also handled via the  Configuration.Proj file.
  • Updating project references to Sitecore.FakeDB. The older versions of Sitecore reference version 1.4, for Sitecore 9.x the unit tests need to reference version 2.0. This is handled in the  Configuration.Proj file.
  • Update the unit tests to support the new Sitecore abstractions in 9.x versions and make sure that the tests will also run with older versions of Sitecore. This involves a lot of preprocessor directives, a good example is the SitecoreFieldLinkMapperFixture.
  • Fixing any units that are broken.

Build Changes:

  • Add build steps for Sitecore 9.1 to the current build process. There are currently two steps; a compile step and a nuget package step.

 

Glass needs your support!

Glass.Mappper.Sc is supported by the generous donations of the Glass.Mapper.Sc community! Their donations help fund the time, effort and hosting for the project.

These supporters are AMAZING and a huge thank you to all of you. You can find our list of supporters on the Rockstars page.

If you use Glass.Mapper.Sc and find it useful please consider supporting the project. Not only will you help the project but you could also get a discount on the Glass.Mapper.Sc training and join the Rockstars page.

Become a Rockstar