ABTesting / KPI error in CMS 12

Vote:
 

Hello,

We migrated our project from CMS 11 to 12 using upgrade assistant and resolved build errors related packages that are no longer supported and added packages wherever its being removed by tool and it required for project to run and updated code to support .Net core standard.

Now when we run application we are getting this error:

info: EPiServer.Framework.Initialization.InitializationEngine[0]
      Initialization started
fail: EPiServer.Framework.Initialization.InitializationEngine[0]
      Initialize action failed for 'Initialize on class EPiServer.Data.DataInitialization, EPiServer.Data, Version=12.8.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7'
      System.InvalidOperationException: Unable to resolve service for type 'EPiServer.Marketing.KPI.Dal.KpiDatabaseContext' while attempting to activate 'EPiServer.Marketing.KPI.Dal.BaseRepository'.
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateArgumentCallSites(Type serviceType, Type implementationType, CallSiteChain callSiteChain, ParameterInfo[] parameters, Boolean throwIfCallSiteNotFound)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache lifetime, Type serviceType, Type implementationType, CallSiteChain callSiteChain)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, Type serviceType, CallSiteChain callSiteChain, Int32 slot)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(Type serviceType, CallSiteChain callSiteChain)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateCallSite(Type serviceType, CallSiteChain callSiteChain)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.<>c__DisplayClass7_0.<GetCallSite>b__0(Type type)
         at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetCallSite(Type serviceType, CallSiteChain callSiteChain)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateArgumentCallSites(Type serviceType, Type implementationType, CallSiteChain callSiteChain, ParameterInfo[] parameters, Boolean throwIfCallSiteNotFound)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache lifetime, Type serviceType, Type implementationType, CallSiteChain callSiteChain)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, Type serviceType, CallSiteChain callSiteChain, Int32 slot)
         at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(Type serviceType, CallSiteChain callSiteChain)

As per this  blog https://kunalshetye.com/posts/add-a-b-testing-to-cms12/ added line in startup.cs file

services.AddABTesting(_configuration.GetConnectionString("EPiServerDB")); 

But this line is giving error for AddABTesting() method for missing reference.

Can anyone help with this error and how to resolve this?

#283680
Jul 14, 2022 8:11
Vote:
 

Do you have the "EPiServer.Marketing.Testing" NuGet package installed?

#283691
Jul 14, 2022 16:08
Vote:
 

Yes installed EPiServer.Marketing.Testing version 3.1.0

#283727
Jul 15, 2022 5:41
Vote:
 

Because of 3.1.0 version it was not working as it's for .net 6 and it was not working. Now installed 3.0.0 which is for .Net 5 and it's working fine.

Thank you.

#283742
Edited, Jul 15, 2022 8:29
Vote:
 

Right. I noticed that. Version 3.1.0 is .NET 6 only.

#283751
Jul 15, 2022 16:33
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.