ModuleLoader issue in Kentico 9.0.45

Baltasar Romero asked on October 15, 2019 02:13

Hi I'm trying to run an existing website that was built using Kentico version 9.0.45 and I get the following error. Error CS0311 The type 'CMSModuleLoader' cannot be used as type parameter 'T' in the generic type or method 'CMS.Core.ModuleEntryManager.EnsureModule

Recent Answers


David te Kloese answered on October 15, 2019 11:36

Do you run this local where you have access to the code?

Any custom module installed? if so check if the module in initialized correctly like: docs.kentico.com/k9/.../initializing-modules-to-run-custom-code

Try a clean rebuild of the code...

If it is a running existing website any changes? Upgrade / Hotfix / Windows Update / ...?

0 votesVote for this answer Mark as a Correct answer

Michal Samuhel answered on October 15, 2019 12:06

CMSModuleLoader is quite old on its own and depends which class is custom module trying to extend... If you are trying to run the site, rebuild should be enough, though it depends on context of code. For example "Registering event handlers using the CMSModuleLoader class only works in the App_Code folder of the Kentico web project (CMS or CMSApp)." To make project more future proof or upgradable, please consider running customizations as custom module as David mentions in his post.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.