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

207 views Asked by At

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?

4

There are 4 answers

3
trucker_jim On BEST ANSWER

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.

1
jurajo On

The integration NuGet packages are dedicated to be used in the MVC front end app. You shall not use them in the admin app!!! You cannot use MVC app NuGet packages in web form app. In order to make the admin app run again, uninstall the packages. If it will not help, I would recommend installing a fresh admin app as it is possible that the packages installed other dependencies and messed up the admin app solution beyond repair.

2
Brenden Kehren On

I've went down the path of trying to use packages for the CMS project with a version 12 and version 13 site before. It took some time to do the conversion, I was able to get the CMS site running, but in the long run I wasn't happy with it because when I tried to hotfix the CMS application using the Kentico Installation Manager (KIM) it failed miserably and I was forced to revert back to using the assemblies in the LIB directory.

Long story short is if you want to use packages in the CMS you need to find all of the specific packages and proper versions to reference them. You will NOT find any packages for Kentico's CMS version, those will have to be referenced by the LIB folder.

0
Elmar Höfinghoff On

You can do this, but the CMS must not use the MVC libraries. Only use the Kentico.Xperience Libraries without MVC. If you do, remove the XCopy command from the build process which copies the DLLs from the Lib folder into the CMS bin. Kentico has three Nuget packages, one for "basic core api" (that's what you can use in the CMSApp). The others are only for MVC. One with Frontend files and another one without.