kenticokentico-12kentico-mvc

Kentico12 Additional assemblies have to be registered before application pre-initialization


The current project I have inherited is a Kentico 12 MVC implementation. I successfully got the CMS Admin site running. It currently references a bunch of assemblies in a Lib folder. They are version 12.0.29.

I decided that I wanted to change to use the Kentico nuget packages instead of referencing the files in the Lib folder, with an eye to upgrading the site to a later version. To ensure I wouldn't break anything, I decided to install the same version of Kentico 12 via the nuget package installer. So in nuget I selected Kentico.AspNet.Mvc, selected version 12.0.29, then clicked Install.

Choosing this package will also install Kentico.Libraries 12.0.29, Kentico.LanguagePack.English 12.0.29, and Kentico.AspNet.Mvc.Libraries 12.0.29. I worked my way up to this package, installing the other packages until I finally replaced all the components that my MVC app references.

I clicked install, and it installed successfully. I then cleaned the solution, then I ran the site. The site runs, but then it gets an error:

Error message

What additional assembies is it talking about? How can I fix this problem?


Solution

  • Don't do that, the CMS site references that point to the LIB folder must be left alone.

    Yes, the MVC site references the Kentico NuGet packages..but I made that mistake too and it was a nightmare to fix.

    If you move the CMS references from the LIB folder to NuGet you will break the ability for Kentico Installation Manager (KIM) to upgrade / hotfix your CMS!!! That is how you should upgrade it. Also, did you think about the database? It also needs to be upgraded...KIM does that for you.

    My Advice: don't mess with any of the Kentico dependencies, use Kentico Installation Manager to upgrade your development CMS site & database.

    Then use NuGet to align your MVC site to the same version as the CMS. Sure, add references to other NuGet packages, but don't mess with the Kentico dependencies!!

    Once done and ready to deploy, you get the SQL update script from the CMS site folder (KIM puts a SQL file there) and update your Test & Live database versions as part of deployment.