Kentico Xperience 13 Web API dll dependency to Microsoft.Extensions.DependencyInjection.Abstractions

Vladut NG asked on February 21, 2024 23:27

I attempted installs of Xperience 13 Refresh9 and also Refresh11 with the same results documented below. Please note that these same steps work on a Kentico 12 installation.

I am following instructions from a combination of the below:

Specificall,y trying to Import-Module the assemblies CMS.DataEngine.dll and CMS.Membership.dll in the current session to execute [CMS.DataEngine.CMSApplication]::Init() and [CMS.Membership.UserInfoProvider]::GetUserInfo($CMSUser).

Although I see that the project has a dependency to Microsoft.Extensions.DependencyInjection.Abstractions v3.1.8.0, attempts to load CMS.DataEngine.dll all fail with below error:

Exception calling "Init" with "0" argument(s): "Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The system cannot find the file specified." + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException

The project has in Lib\, CMS\bin and in the Kentico v13 Program itself under bin\CMS directories only assemblies of version for this package. Attempts to downgrade the packages end up with circular dependencies in downgrades to other Microsoft.* packages and break Xperience 13 completely.

Edit: I am seeing the same error with both MVC5 and Core Kentico v13.

Recent Answers

Dhruv Jain answered on April 15, 2024 15:37

I am facing a similar issue. CMS.Core is using v3.1.8.0 but somehow it is trying to find version I also checked our project. We are not using Microsoft.Extensions.DependencyInjection.Abstractions v3.1.0.0 anywhere in the code.

System.IO.FileLoadException HResult=0x80131040 Message=Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Source=CMS.Core StackTrace: at CMS.Core.IoCContainer..ctor() at CMS.Core.TypeManager.get_IoCContainer() at CMS.Core.Service.ResolveOptionalTService at CMS.Base.RequestItems.get_CurrentItems() at CMS.Helpers.AbstractStockHelper`1.GetItem(String key, Boolean caseSensitive) at CMS.Helpers.VirtualContext.GetItem(String key) at CMS.SiteProvider.SiteContext.get_CurrentSiteName()

0 votesVote for this answer Mark as a Correct answer

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