Sitecore 9.3 Pipeline processor adjustments

I had a custom cache built with my 8.1 solution. When moving it over, I started to get:

Could not create instance of type: MyProcessor. No matching constructor was found.

Initially I looked at the decompiled class that I was extended to see if anything had changed from 8.1 to 9.3. Hmm… everything looked normal. Well it turns out that with Sitecore 9.3, that you need to add resolve=”true” to the modified configurations to allow for dependency injection to work when they are within the following pipelines:
<mvc.getPageItem>
 <mvc.renderRendering>

 <mvc.renderRendering>
        <processor          patch:instead="processor[@type='Sitecore.Mvc.Pipelines.Response.RenderRendering.SetCacheability, Sitecore.Mvc']"
          type="MySolution.Pipelines.Rendering.SetCacheability, MySolution" resolve="true"/>
        <processor           patch:instead="processor[@type='Sitecore.Mvc.Pipelines.Response.RenderRendering.GenerateCacheKey, Sitecore.Mvc']"
          type="MySolution.Pipelines.Rendering.CoreCacheKey,MySolution" resolve="true" />
      </mvc.renderRendering>

Hat Tip to: Matt Fletcher : https://www.mattfletcher.co.uk/2020/06/10/case-study-upgrading-sitecore-9-01-to-9-3/

Note: Decided to isolate as it was part of a larger migration blog post. Well done Matt! 

Comments