{"id":43,"date":"2017-05-14T06:41:26","date_gmt":"2017-05-14T06:41:26","guid":{"rendered":"http:\/\/gingeraroundtheworld.com\/SyntacticSugar\/?p=43"},"modified":"2017-05-14T07:05:44","modified_gmt":"2017-05-14T07:05:44","slug":"solving-episerver-framework-initialization-initializationengine-initialize-action-failed-for-initialize-on-class-episerver-enterprise-internal-enterpriseinitialization","status":"publish","type":"post","link":"http:\/\/gingeraroundtheworld.com\/SyntacticSugar\/2017\/05\/14\/solving-episerver-framework-initialization-initializationengine-initialize-action-failed-for-initialize-on-class-episerver-enterprise-internal-enterpriseinitialization\/","title":{"rendered":"Solving EPiServer.Framework.Initialization. InitializationEngine: Initialize action failed for &#8216;Initialize on class EPiServer.Enterprise.Internal. EnterpriseInitialization,"},"content":{"rendered":"<body><p>Recently I was upgrading an Episerver project to v10.9.0 using nuget package manager. I also upgraded the database by entering <em><strong>Update-EPiDatabase -verbose:$true<\/strong><\/em> in the nuget package manager console in visual studio.<\/p>\n<p>When trying to run the website I got a http 500 error. In the logs I could see the stacktracke below.<\/p>\n<p><code>ERROR EPiServer.Framework.Initialization.InitializationEngine: Initialize action failed for 'Initialize on class EPiServer.Enterprise.Internal.EnterpriseInitialization, EPiServer.Enterprise, Version=10.9.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7'<br>\nEPiServer.ServiceLocation.ActivationException: Activation error occurred while trying to get instance of type PropertyContentReferenceListTransform, key \"\" ---&gt; StructureMap.Building.StructureMapBuildException: Error while building type EPiServer.Core.Transfer.Internal.DependentContentTransfer.  See the inner exception for details<br>\n1.) new DependentContentTransfer(*Default of IContentLoader*, *Default of IContentTypeRepository*, *Default of IPermanentLinkMapper*, *Default of ISiteDefinitionRepository*, *Default of ContentRootService*)<br>\n2.) EPiServer.Core.Transfer.Internal.DependentContentTransfer<br>\n3.) Instance of EPiServer.Core.Transfer.IDependentContentTransfer (EPiServer.Core.Transfer.Internal.DependentContentTransfer)<br>\n4.) new PropertyContentReferenceListTransform(*Default of IPermanentLinkMapper*, *Default of IContentLoader*, *Default of IDependentContentTransfer*)<br>\n5.) EPiServer.Core.Transfer.Internal.PropertyContentReferenceListTransform<br>\n6.) Instance of EPiServer.Core.Transfer.Internal.PropertyContentReferenceListTransform<br>\n7.) Container.GetInstance(EPiServer.Core.Transfer.Internal.PropertyContentReferenceListTransform)<\/code><br>\n\u2026 full stack trace at the end of the post.<\/p>\n<h2>The solution<\/h2>\n<p>In the connection string the MultipleActiveResultSets=True was missing. Once I added it, the site was working again.<br>\n<code>&lt;add name=\"EPiServerDB\" connectionString=\"Data Source=XXXX;Initial Catalog=XXXX;Integrated Security=False;User ID=XXXX;Password=XXXX;Connect Timeout=30;&lt;strong&gt;<strong>MultipleActiveResultSets=True<\/strong>&lt;\/strong&gt;\" providerName=\"System.Data.SqlClient\" \/&gt;&lt;\/pre&gt;<\/code><\/p>\n<h2>The full stacktrace<\/h2>\n<p>This is the full stacktrace of the error:<\/p>\n<p><code>ERROR EPiServer.Framework.Initialization.InitializationEngine: Initialize action failed for 'Initialize on class EPiServer.Enterprise.Internal.EnterpriseInitialization, EPiServer.Enterprise, Version=10.9.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7'<br>\nEPiServer.ServiceLocation.ActivationException: Activation error occurred while trying to get instance of type PropertyContentReferenceListTransform, key \"\" ---&gt; StructureMap.Building.StructureMapBuildException: Error while building type EPiServer.Core.Transfer.Internal.DependentContentTransfer.  See the inner exception for details<br>\n1.) new DependentContentTransfer(*Default of IContentLoader*, *Default of IContentTypeRepository*, *Default of IPermanentLinkMapper*, *Default of ISiteDefinitionRepository*, *Default of ContentRootService*)<br>\n2.) EPiServer.Core.Transfer.Internal.DependentContentTransfer<br>\n3.) Instance of EPiServer.Core.Transfer.IDependentContentTransfer (EPiServer.Core.Transfer.Internal.DependentContentTransfer)<br>\n4.) new PropertyContentReferenceListTransform(*Default of IPermanentLinkMapper*, *Default of IContentLoader*, *Default of IDependentContentTransfer*)<br>\n5.) EPiServer.Core.Transfer.Internal.PropertyContentReferenceListTransform<br>\n6.) Instance of EPiServer.Core.Transfer.Internal.PropertyContentReferenceListTransform<br>\n7.) Container.GetInstance(EPiServer.Core.Transfer.Internal.PropertyContentReferenceListTransform)<br>\n---&gt; System.TypeInitializationException: The type initializer for 'EPiServer.Web.SiteDefinition' threw an exception. ---&gt; System.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first.<br>\n   at System.Data.SqlClient.SqlInternalConnectionTds.ValidateConnectionForExecute(SqlCommand command)<br>\n   at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)<br>\n   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task&amp; task, Boolean asyncWrite)<br>\n   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)<br>\n   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)<br>\n   at EPiServer.DataAccess.Internal.ContentListDB.<loaddefaultsystemroots>b__8_0()<br>\n   at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.&lt;&gt;c__DisplayClass31_0`1.<execute>b__0()<br>\n   at EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute[TResult](Func`1 method)<br>\n   at EPiServer.DataAbstraction.Internal.DefaultContentRootRepository.EnsureSystemRoots()<br>\n   at EPiServer.DataAbstraction.Internal.DefaultContentRootRepository.Load(String rootName)<br>\n   at EPiServer.Web.SystemDefinition.get_Current()<br>\n   at EPiServer.Web.SiteDefinition.get_SiteAssetsRoot()<br>\n   at EPiServer.Web.SiteDefinition.MakeReadOnly()<br>\n   at EPiServer.Web.SiteDefinition..cctor()<br>\n   --- End of inner exception stack trace ---<br>\n   at EPiServer.DataAccess.Internal.SiteDefinitionDB.SiteDefinitionFromReader(IDataRecord r)<br>\n   at EPiServer.DataAccess.Internal.SiteDefinitionDB.<list>b__4_0()<br>\n   at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.&lt;&gt;c__DisplayClass31_0`1.<execute>b__0()<br>\n   at EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute[TResult](Func`1 method)<br>\n   at EPiServer.Web.Internal.DefaultSiteDefinitionRepository.List()<br>\n   at EPiServer.Core.Transfer.Internal.DependentContentTransfer..ctor(IContentLoader contentLoader, IContentTypeRepository contentTypeRepository, IPermanentLinkMapper permanentLinkMapper, ISiteDefinitionRepository siteRepository, ContentRootService contentRootService)<br>\n   at lambda_method(Closure , IBuildSession , IContext )<br>\n   --- End of inner exception stack trace ---<br>\n   at lambda_method(Closure , IBuildSession , IContext )<br>\n   at StructureMap.Building.BuildPlan.Build(IBuildSession session, IContext context) in c:\\BuildAgent\\work\\a395dbde6b793293\\src\\StructureMap\\Building\\BuildPlan.cs:line 151<br>\n   at StructureMap.SessionCache.GetObject(Type pluginType, Instance instance, ILifecycle lifecycle) in c:\\BuildAgent\\work\\a395dbde6b793293\\src\\StructureMap\\SessionCache.cs:line 93<br>\n   at StructureMap.SessionCache.GetDefault(Type pluginType, IPipelineGraph pipelineGraph) in c:\\BuildAgent\\work\\a395dbde6b793293\\src\\StructureMap\\SessionCache.cs:line 68<br>\n   at StructureMap.Container.GetInstance(Type pluginType) in c:\\BuildAgent\\work\\a395dbde6b793293\\src\\StructureMap\\Container.cs:line 337<br>\n   at EPiServer.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)<br>\n   --- End of inner exception stack trace ---<br>\n   at EPiServer.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)<br>\n   at EPiServer.ServiceLocation.ServiceLocatorImplBase.GetInstance[TService]()<br>\n   at EPiServer.Enterprise.Internal.EnterpriseInitialization.RegisterImportingEventHandlers(IDataImportEvents importerEvents, IServiceLocator factory)<br>\n   at EPiServer.Enterprise.Internal.EnterpriseInitialization.Initialize(InitializationEngine context)<br>\n   at EPiServer.Framework.Initialization.Internal.ModuleNode.Execute(Action a, String key)<br>\n   at EPiServer.Framework.Initialization.Internal.ModuleNode.Initialize(InitializationEngine context)<br>\n   at EPiServer.Framework.Initialization.InitializationEngine.InitializeModules()<br>\nEPiServer.ServiceLocation.ActivationException: Activation error occurred while trying to get instance of type PropertyContentReferenceListTransform, key \"\" ---&gt; StructureMap.Building.StructureMapBuildException: Error while building type EPiServer.Core.Transfer.Internal.DependentContentTransfer.  See the inner exception for details<br>\n1.) new DependentContentTransfer(*Default of IContentLoader*, *Default of IContentTypeRepository*, *Default of IPermanentLinkMapper*, *Default of ISiteDefinitionRepository*, *Default of ContentRootService*)<br>\n2.) EPiServer.Core.Transfer.Internal.DependentContentTransfer<br>\n3.) Instance of EPiServer.Core.Transfer.IDependentContentTransfer (EPiServer.Core.Transfer.Internal.DependentContentTransfer)<br>\n4.) new PropertyContentReferenceListTransform(*Default of IPermanentLinkMapper*, *Default of IContentLoader*, *Default of IDependentContentTransfer*)<br>\n5.) EPiServer.Core.Transfer.Internal.PropertyContentReferenceListTransform<br>\n6.) Instance of EPiServer.Core.Transfer.Internal.PropertyContentReferenceListTransform<br>\n7.) Container.GetInstance(EPiServer.Core.Transfer.Internal.PropertyContentReferenceListTransform)<br>\n---&gt; System.TypeInitializationException: The type initializer for 'EPiServer.Web.SiteDefinition' threw an exception. ---&gt; System.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first.<br>\n   at System.Data.SqlClient.SqlInternalConnectionTds.ValidateConnectionForExecute(SqlCommand command)<br>\n   at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)<br>\n   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task&amp; task, Boolean asyncWrite)<br>\n   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)<br>\n   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)<br>\n   at EPiServer.DataAccess.Internal.ContentListDB.<loaddefaultsystemroots>b__8_0()<br>\n   at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.&lt;&gt;c__DisplayClass31_0`1.<execute>b__0()<br>\n   at EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute[TResult](Func`1 method)<br>\n   at EPiServer.DataAbstraction.Internal.DefaultContentRootRepository.EnsureSystemRoots()<br>\n   at EPiServer.DataAbstraction.Internal.DefaultContentRootRepository.Load(String rootName)<br>\n   at EPiServer.Web.SystemDefinition.get_Current()<br>\n   at EPiServer.Web.SiteDefinition.get_SiteAssetsRoot()<br>\n   at EPiServer.Web.SiteDefinition.MakeReadOnly()<br>\n   at EPiServer.Web.SiteDefinition..cctor()<br>\n   --- End of inner exception stack trace ---<br>\n   at EPiServer.DataAccess.Internal.SiteDefinitionDB.SiteDefinitionFromReader(IDataRecord r)<br>\n   at EPiServer.DataAccess.Internal.SiteDefinitionDB.<list>b__4_0()<br>\n   at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.&lt;&gt;c__DisplayClass31_0`1.<execute>b__0()<br>\n   at EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute[TResult](Func`1 method)<br>\n   at EPiServer.Web.Internal.DefaultSiteDefinitionRepository.List()<br>\n   at EPiServer.Core.Transfer.Internal.DependentContentTransfer..ctor(IContentLoader contentLoader, IContentTypeRepository contentTypeRepository, IPermanentLinkMapper permanentLinkMapper, ISiteDefinitionRepository siteRepository, ContentRootService contentRootService)<br>\n   at lambda_method(Closure , IBuildSession , IContext )<br>\n   --- End of inner exception stack trace ---<br>\n   at lambda_method(Closure , IBuildSession , IContext )<br>\n   at StructureMap.Building.BuildPlan.Build(IBuildSession session, IContext context) in c:\\BuildAgent\\work\\a395dbde6b793293\\src\\StructureMap\\Building\\BuildPlan.cs:line 151<br>\n   at StructureMap.SessionCache.GetObject(Type pluginType, Instance instance, ILifecycle lifecycle) in c:\\BuildAgent\\work\\a395dbde6b793293\\src\\StructureMap\\SessionCache.cs:line 93<br>\n   at StructureMap.SessionCache.GetDefault(Type pluginType, IPipelineGraph pipelineGraph) in c:\\BuildAgent\\work\\a395dbde6b793293\\src\\StructureMap\\SessionCache.cs:line 68<br>\n   at StructureMap.Container.GetInstance(Type pluginType) in c:\\BuildAgent\\work\\a395dbde6b793293\\src\\StructureMap\\Container.cs:line 337<br>\n   at EPiServer.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)<br>\n   --- End of inner exception stack trace ---<br>\n   at EPiServer.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)<br>\n   at EPiServer.ServiceLocation.ServiceLocatorImplBase.GetInstance[TService]()<br>\n   at EPiServer.Enterprise.Internal.EnterpriseInitialization.RegisterImportingEventHandlers(IDataImportEvents importerEvents, IServiceLocator factory)<br>\n   at EPiServer.Enterprise.Internal.EnterpriseInitialization.Initialize(InitializationEngine context)<br>\n   at EPiServer.Framework.Initialization.Internal.ModuleNode.Execute(Action a, String key)<br>\n   at EPiServer.Framework.Initialization.Internal.ModuleNode.Initialize(InitializationEngine context)<br>\n   at EPiServer.Framework.Initialization.InitializationEngine.InitializeModules()<br>\n<\/execute><\/list><\/execute><\/loaddefaultsystemroots><\/execute><\/list><\/execute><\/loaddefaultsystemroots><\/code><\/p>\n<\/body>","protected":false},"excerpt":{"rendered":"<p>Recently I was upgrading an Episerver project to v10.9.0 using nuget package manager. I also upgraded the database by entering Update-EPiDatabase -verbose:$true in the nuget package manager console in visual studio. When trying to run the website I got a http 500 error. In the logs I could see the stacktracke below. ERROR EPiServer.Framework.Initialization.InitializationEngine: Initialize &hellip; <a href=\"http:\/\/gingeraroundtheworld.com\/SyntacticSugar\/2017\/05\/14\/solving-episerver-framework-initialization-initializationengine-initialize-action-failed-for-initialize-on-class-episerver-enterprise-internal-enterpriseinitialization\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Solving EPiServer.Framework.Initialization. InitializationEngine: Initialize action failed for &#8216;Initialize on class EPiServer.Enterprise.Internal. EnterpriseInitialization,<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3,10],"tags":[],"class_list":["post-43","post","type-post","status-publish","format-standard","hentry","category-cms","category-episerver"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/gingeraroundtheworld.com\/SyntacticSugar\/wp-json\/wp\/v2\/posts\/43","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/gingeraroundtheworld.com\/SyntacticSugar\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/gingeraroundtheworld.com\/SyntacticSugar\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/gingeraroundtheworld.com\/SyntacticSugar\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/gingeraroundtheworld.com\/SyntacticSugar\/wp-json\/wp\/v2\/comments?post=43"}],"version-history":[{"count":1,"href":"http:\/\/gingeraroundtheworld.com\/SyntacticSugar\/wp-json\/wp\/v2\/posts\/43\/revisions"}],"predecessor-version":[{"id":53,"href":"http:\/\/gingeraroundtheworld.com\/SyntacticSugar\/wp-json\/wp\/v2\/posts\/43\/revisions\/53"}],"wp:attachment":[{"href":"http:\/\/gingeraroundtheworld.com\/SyntacticSugar\/wp-json\/wp\/v2\/media?parent=43"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/gingeraroundtheworld.com\/SyntacticSugar\/wp-json\/wp\/v2\/categories?post=43"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/gingeraroundtheworld.com\/SyntacticSugar\/wp-json\/wp\/v2\/tags?post=43"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}