Views: 1042
Number of votes: 5
Average rating:

Issue with modules not being found in CMS 11

Hello everyone! I want to quickly address the issues around add-on modules not being found after upgrading to CMS 11 before misinformation starts to spread. Marija mentioned some of these issues in her previous blog post and there have been some questions on the forum.

The problem usually manifests itself as either an assembly not being found at runtime or a route not resolving correctly in the UI.

It is caused by the following, and I'm not sure if this is a breaking change but as far as I know it has not been documented (I will have the breaking changes document updated in any case). As part of the CMS 11 release the dependencies of the EPiServer.CMS nuget package were changed to no longer include EPiServer.Packaging.UI, you can compare the versions here:

For some reason, unknown to me, having EPiServer.Packaging installed changes the default behavior of the modules system to scan the protected modules folder and automatically load modules found there during startup. The default behavior without it installed is not to scan the protected modules folder. However this can be configured via the section of the web.config.

So there are a couple of easy options to fix this, either:

1. Add autoDiscovery="Modules" to the protectedModules element under in the web.config

<protectedModules rootPath="~/EPiServer/" autoDiscovery="Modules />

2. Or add each protected module that should be loaded as a child to the protectedModules element (this is the default setup)

<protectedModules rootPath="~/EPiServer/">
  <add name="Shell" />
  <add name="CMS" />
  <add name="EPiServer.Cms.TinyMce" />

Also as a side note, I recommend against installing EPiServer.Packaging. The recommended way of installing add-ons is via nuget.

    (By Marija Jemuovic , 08 January 2018 15:00, Permanent link)

    Thx a lot, Ben! Will update my post promptly :)

    (By Vincent Baaij , 08 January 2018 16:01, Permanent link)

    Too bad EPiServer Social Reach has a dependency on EPiServer.Packaging. Do you know why that is?

    (By Ben McKernan , 08 January 2018 16:54, Permanent link)

    @Marija great thanks!

    @Vincent I'm not sure why they have a dependency on packaging. I don't like being pessimistic but it probably is because they didn't know how the module resolving worked and having packaging installed fixed the problems described in this post.

    I should also mention that episerver add-ons usually add themselves to that protected modules list when installing the nuget package. This is done via a web.config transform.

    (By David Elias , 08 January 2018 18:02, Permanent link)

    There are actually a lot things that have a dependency on EPiServer.Packaging.  Out of curriosity, I just tried to remove it and have 4 other packages that all have a dependency on it.

  Please login to post a comment