I am working on a Sitecore upgrade project and we are encountering an issue after our solution upgrade.
Below is the attached screenshot.
Server Error in '/' Application.
________________________________________
Implementation type 'Sitecore.XA.Foundation.Variants.Abstractions.Services.PassthroughService' can't be converted to service type 'Sitecore.XA.Foundation.Variants.Abstractions.Services.IPassthroughService'
Description: An unhandled exception occurred.
Exception Details: System.ArgumentException: Implementation type 'Sitecore.XA.Foundation.Variants.Abstractions.Services.PassthroughService' can't be converted to service type 'Sitecore.XA.Foundation.Variants.Abstractions.Services.IPassthroughService'
Source Error:
Line 13: foreach (BaseVariantField variantField in Model.VariantFields)
Line 14: {
Line 15: @Html.RenderingVariants().RenderVariant(variantField, Model.Item, Model.RenderingWebEditingParams, Model)
Line 16: }
Line 17: }
Source File: c:\inetpub\wwwroot\sc102sc.dev.local\Views\Variants\Page Content.cshtml Line: 15
Stack Trace:
[ArgumentException: Implementation type 'Sitecore.XA.Foundation.Variants.Abstractions.Services.PassthroughService' can't be converted to service type 'Sitecore.XA.Foundation.Variants.Abstractions.Services.IPassthroughService']
Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite..ctor(ResultCache cache, Type serviceType, ConstructorInfo constructorInfo, ServiceCallSite[] parameterCallSites) +246
Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache lifetime, Type serviceType, Type implementationType, CallSiteChain callSiteChain) +455
Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, Type serviceType, CallSiteChain callSiteChain, Int32 slot) +377
Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(Type serviceType, CallSiteChain callSiteChain) +84
Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateCallSite(Type serviceType, CallSiteChain callSiteChain) +152
System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) +75
Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.CreateServiceAccessor(Type serviceType) +97
System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) +75
Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope) +46
Microsoft.Extensions.DependencyInjection.ConstructorMatcher.CreateInstance(IServiceProvider provider) +132
Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanceType, Object[] parameters) +485
Sitecore.Configuration.DefaultFactory.CreateFromServiceProvider(XmlNode configNode, Boolean assert) +481
[ConfigurationException: Could not create object from service provider . Config XML: <processor type="VGWMP.Foundation.HCPSiteExtensions.Pipelines.RenderVariantField.RenderSortedReference, VGWMP.Foundation.HCPSiteExtensions" resolve="true" patch:source="VGWMP.Foundation.HCPSiteExtensions.VariantField.config" xmlns:patch="http://www.sitecore.net/xmlconfig/" />]
Sitecore.Configuration.DefaultFactory.CreateFromServiceProvider(XmlNode configNode, Boolean assert) +641
Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +138
Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, Boolean assert) +68
Sitecore.Pipelines.CorePipelineFactory.GetObjectFromType(XmlNode processorNode) +91
Sitecore.Pipelines.CorePipelineFactory.GetProcessorObject(XmlNode processorNode) +138
Sitecore.Pipelines.CoreProcessor.GetMethod(Object[] parameters) +136
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +1255
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.XA.Foundation.RenderingVariants.Pipelines.RenderVariantField.RenderSection.RenderField(RenderVariantFieldArgs args) +420
Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.RenderVariantField.RenderVariantFieldProcessor.Process(RenderVariantFieldArgs args) +114
(Object , Object ) +9
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +1268
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.XA.Foundation.RenderingVariants.Pipelines.RenderVariantField.RenderSection.RenderField(RenderVariantFieldArgs args) +420
Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.RenderVariantField.RenderVariantFieldProcessor.Process(RenderVariantFieldArgs args) +114
(Object , Object ) +9
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +1268
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.XA.Foundation.RenderingVariants.Pipelines.RenderVariantField.RenderReference.RenderField(RenderVariantFieldArgs args) +631
Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.RenderVariantField.RenderVariantFieldProcessor.Process(RenderVariantFieldArgs args) +132
(Object , Object ) +9
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +1268
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.XA.Foundation.RenderingVariants.Pipelines.RenderVariantField.RenderSection.RenderField(RenderVariantFieldArgs args) +420
Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.RenderVariantField.RenderVariantFieldProcessor.Process(RenderVariantFieldArgs args) +132
(Object , Object ) +9
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +1268
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.XA.Foundation.RenderingVariants.Pipelines.RenderVariantField.RenderSection.RenderField(RenderVariantFieldArgs args) +420
Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.RenderVariantField.RenderVariantFieldProcessor.Process(RenderVariantFieldArgs args) +132
(Object , Object ) +9
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +1268
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.XA.Foundation.RenderingVariants.Pipelines.RenderVariantField.RenderSection.RenderField(RenderVariantFieldArgs args) +420
Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.RenderVariantField.RenderVariantFieldProcessor.Process(RenderVariantFieldArgs args) +132
(Object , Object ) +9
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +1268
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.XA.Foundation.RenderingVariants.Pipelines.RenderVariantField.RenderSection.RenderField(RenderVariantFieldArgs args) +420
Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.RenderVariantField.RenderVariantFieldProcessor.Process(RenderVariantFieldArgs args) +132
(Object , Object ) +9
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +1268
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.XA.Foundation.RenderingVariants.Pipelines.RenderVariantField.RenderSection.RenderField(RenderVariantFieldArgs args) +420
Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.RenderVariantField.RenderVariantFieldProcessor.Process(RenderVariantFieldArgs args) +132
(Object , Object ) +9
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +1268
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.XA.Foundation.RenderingVariants.Pipelines.RenderVariantField.RenderSection.RenderField(RenderVariantFieldArgs args) +420
Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.RenderVariantField.RenderVariantFieldProcessor.Process(RenderVariantFieldArgs args) +132
(Object , Object ) +9
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +1268
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.XA.Foundation.RenderingVariants.Pipelines.RenderVariantField.RenderSection.RenderField(RenderVariantFieldArgs args) +420
Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.RenderVariantField.RenderVariantFieldProcessor.Process(RenderVariantFieldArgs args) +114
(Object , Object ) +9
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +1268
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.XA.Foundation.Variants.Abstractions.Renderers.VariantRenderer.RenderVariantField(BaseVariantField variant, Item item, Dictionary`2 parameters) +240
Sitecore.XA.Foundation.RenderingVariants.Extensions.RenderingVariantsExtensions.RenderVariant(BaseVariantField variantField, Item item, RenderingWebEditingParams parameters, Object model, Func`3 hrefOverrideFunc) +207
ASP._Page_Views_Variants_Page_Content_cshtml.Execute() in c:\inetpub\wwwroot\sc102sc.dev.local\Views\Variants\Page Content.cshtml:15
System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +148
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +122
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +378
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +91
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +795
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +795
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +81
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +698