Upgrading DynamicRouting

Mike Matthes asked on January 19, 2021 15:25

Hi, I'm having an issue with upgrading the DynamicRouting module. This is for the DynamicRouting module that installs in the Kentico Admin Console. I used nuget to upgrade my local instance from 12.29.9 to 12.29.18. The local upgrade ran smoothly and works fine.

Then I deployed my Admin Console to Azure, which hosts my website. The files copy correctly to Azure, but upon running the Admin Console, I'm getting the error below:

Any ideas? I already make sure to delete this zip file from Azure /App_Data/CMSModules/DynamicRouting.Kentico/Install/DynamicRouting.Kentico_12.29.9.zip

Message: Collecting of installed modules failed. The module 'DynamicRouting.Kentico' is present in more than one version (12.29.18 and 12.29.9). This is typically a result of append only deployment after updating module to newer version. All old module files must be removed when deploying an updated module.

Exception type: System.InvalidOperationException Stack trace: at CMS.Modules.InstallableModulesState.CreateInstalledModulesDictionary() at CMS.Modules.InstallableModulesState.FillDictionaries() at CMS.Modules.InstallableModulesManager.GetCurrentState() at CMS.Modules.ModuleInstaller.ProcessInstallation()

Correct Answer

Mike Matthes answered on January 19, 2021 16:52

I have figured out the issue.

The /App_Data/CMSModules/CMSInstallation/Packages/Installed directory had 2 files: DynamicRouting.Kentico_12.29.9.xml and DynamicRouting.Kentico_12.29.18.xml. I deleted DynamicRouting.Kentico_12.29.9.xml and then the module updated in Azure correctly.

Also note, I had previously deleted the DynamicRouting.Kentico_12.29.9.zip file from the /App_Data/CMSModules/DynamicRouting.Kentico/Install directory

1 votesVote for this answer Unmark Correct answer

Recent Answers

Brenden Kehren answered on January 19, 2021 15:43

When you're deleting the file, make sure you're deleting it from your project in Visual Studio as well. Most likely the .csproj file still has reference to that file and can't find it so it breaks the build.

0 votesVote for this answer Mark as a Correct answer

Mike Matthes answered on January 19, 2021 15:54

Thanks for the suggestion. The csproj file looks to be referencing the correct zip file for version 12.29.18. When deploying to Azure, the VS publish runs fine. It's when starting the Admin Console that I get the error above.

One more thought is, where does CMS.Modules.ModuleInstaller.ProcessInstallation() look to find the modules? If I can figure out where this method is looking, then maybe I'll find 2 versions of the module.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on January 19, 2021 16:24 (last edited on January 20, 2021 15:45)

The ProcessInstallation() method runs at application startup and looks through the assemblies in the project for any decorators on classes specifying them as a module.

What I'd suggest doing is totally uninstalling the Nuget package. Verifying the uninstall in Visual Studio by:

  • deleting the dynamic routing zip files from this directory ..CMS\App_Data\CMSModules\CMSInstallation\Packages\Installed
  • deleting this directory ..CMS\App_Data\CMSModules\DynamicRouting.Kentico
  • deleting this file ..\CMS\bin\DynamicRouting.Kentico.Base.dll
  • deleting this file ..\CMS\bin\DynamicRouting.Kentico.dll
  • deleting this directory ..\CMS\CMSModules\DynamicRouting.Kentico

Then reinstall the Nuget package with the version you want.

I'd also suggest making sure your MVC site is cleaned out and all old references are removed. Similarly to the Xperience site, look for directories/files related to DynamicRouting after you remove the package. Then reinstall the new version.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on January 19, 2021 16:57

So the info I provided allowed you to find your problem? Glad to be of assistance!

1 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on January 20, 2021 15:42

Thanks BK for the assist! I was helping him on email as well :P

0 votesVote for this answer Mark as a Correct answer

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