I am migrating from Sitecore 8.1 to Sitecore 9.1 and I'm getting this weird error:
Unexpected object type created from configuration node. Expected: Sitecore.ExperienceAnalytics.Core.Diagnostics.ILogger. Got: Sitecore.ExperienceAnalytics.Core.Diagnostics.Logger. XML: Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
The full stacktrace is as follows:
[ConfigurationException: Unexpected object type created from configuration node. Expected: Sitecore.ExperienceAnalytics.Core.Diagnostics.ILogger. Got: Sitecore.ExperienceAnalytics.Core.Diagnostics.Logger. XML: ] Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode) +604 Sitecore.ExperienceAnalytics.Api.ApiContainer.GetUserAccessGuard() +21 Sitecore.ExperienceAnalytics.Api.Http.Filters.DenyAnonymousUserFilterAttribute..ctor() +13 System.RuntimeTypeHandle.CreateCaInstance(RuntimeType type, IRuntimeMethodInfo ctor) +0 System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) +2074 System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit) +205 System.Web.Http.Controllers.HttpControllerDescriptor.InvokeAttributesOnControllerType(HttpControllerDescriptor controllerDescriptor, Type type) +78 System.Web.Http.Controllers.HttpControllerDescriptor..ctor(HttpConfiguration configuration, String controllerName, Type controllerType) +131 System.Web.Http.Dispatcher.DefaultHttpControllerSelector.InitializeControllerInfoCache() +569 System.Lazy`1.CreateValue() +708 System.Lazy`1.LazyInitValue() +184 System.Web.Http.Dispatcher.DefaultHttpControllerSelector.GetControllerMapping() +18 System.Web.Http.Routing.AttributeRoutingMapper.AddRouteEntries(SubRouteCollection collector, HttpConfiguration configuration, IInlineConstraintResolver constraintResolver, IDirectRouteProvider directRouteProvider) +76 System.Web.Http.Routing.c__DisplayClass1_1.b__1() +75 System.Web.Http.Routing.RouteCollectionRoute.EnsureInitialized(Func`1 initializer) +66 System.Web.Http.Routing.c__DisplayClass1_0.b__0(HttpConfiguration config) +125 Sitecore.Services.Infrastructure.Web.Http.ServicesConfigurator.Configure(HttpConfiguration config, RouteCollection routes) +762 Sitecore.Services.Infrastructure.Sitecore.Pipelines.ServicesWebApiInitializer.Process(PipelineArgs args) +194 (Object , Object ) +14 Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484 Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) +236 Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22 Sitecore.Nexus.Web.HttpModule.Application_Start() +215 Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +1184 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +581 System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +168 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +277 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +369 [HttpException (0x80004005): Unexpected object type created from configuration node. Expected: Sitecore.ExperienceAnalytics.Core.Diagnostics.ILogger. Got: Sitecore.ExperienceAnalytics.Core.Diagnostics.Logger. XML: ] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +532 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +111 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +714
The XML configuration line mentioned in the exception comes straight from the Sitecore 9.1 default config.
I inspected the Sitecore.ExperienceAnalytics dll with DotPeek, and I could find no reason why Sitecore.ExperienceAnalytics.Core.Diagnostics.Logger
couldn't implement Sitecore.ExperienceAnalytics.Core.Diagnostics.ILogger
.
Question
Why am I getting this exception? How can I remedy to that?
<logger type="Sitecore.ExperienceAnalytics.Core.Diagnostics.Logger, Sitecore.ExperienceAnalytics.Core" singleInstance="true"/>
but then on the website I get a weird error about an HTML Helper missing when instead it's there:'System.Web.Mvc.HtmlHelper<dynamic>' does not contain a definition...
. If I Build again - rather than Rebuild - I get the same error as before.