Try our conversational search powered by Generative AI!

EPi CMS 7.5 to 9.0 upgrade results in structuremap exception

Vote:
 

Following is the exception. Please help to resolve this issue. Thank you !

Server Error in '/' Application.

Method not found: 'StructureMap.IContainer EPiServer.ServiceLocation.ServiceConfigurationContext.get_Container()'.

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. 

Exception Details: System.MissingMethodException: Method not found: 'StructureMap.IContainer EPiServer.ServiceLocation.ServiceConfigurationContext.get_Container()'.

Source Error: 

[No relevant source lines]


Source File: c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\61f0f580\3fbea218\App_global.asax.0.cs    Line: 0 

Stack Trace: 

[MissingMethodException: Method not found: 'StructureMap.IContainer EPiServer.ServiceLocation.ServiceConfigurationContext.get_Container()'.]
   EPiServer.Mail.Core.EPiServerMailModule.ConfigureContainer(ServiceConfigurationContext context) +0
   EPiServer.Framework.Initialization.ModuleNode.Execute(Action a, String key) +58
   EPiServer.Framework.Initialization.ModuleNode.ConfigureContainer(ServiceConfigurationContext context) +150
   EPiServer.Framework.Initialization.InitializationEngine.ConfigureContainer(HostType hostType) +251
   EPiServer.Framework.Initialization.InitializationEngine.Initialize(HostType hostType) +112
   EPiServer.Framework.Initialization.InitializationModule.Initialize(HostType hostType) +455
   EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType) +100
   EPiServer.Global..ctor() +108
   EPiServer.Templates.RelatePlus.Global..ctor() +37
   ASP.global_asax..ctor() in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\61f0f580\3fbea218\App_global.asax.0.cs:0

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +139
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +105
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +1431
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +184
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +27
   System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +79
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +178
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +341

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +523
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +107
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +688
#199235
Nov 21, 2018 8:27
Vote:
 

You need to have package EPiServer.ServiceLocation.StructureMap installed. Then there is an extension method StructureMap() (in namespace EPiServer.ServiceLocation) that gives you access to the StructureMap container.

You can also use the 'Services' property of ServiceConfigurationContext to configure the IOC container (if you do not use any specific StructureMap feature). See https://world.episerver.com/documentation/developer-guides/CMS/initialization/dependency-injection/

#199249
Nov 21, 2018 15:24
Vote:
 

I did and now i'm getting error while browsing the site.

=> This page isn’t working. redirected you too many times.

#199282
Nov 22, 2018 12:17
Vote:
 

that means that there might be some misconfiguration around authentication as well + some other zillions of issues.

any info about where it tries to redirect you? fragment from network activity maybe?

#199354
Nov 23, 2018 8:09
* 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.