It looks from the error message that Intra.Web.Framework.Initialization.GlobalFiltersInitialization.Initialize tries to get a PopulatePageViewModelActionFilter from the servicelocator and this fails as it's supposed to have an HttpContext lifecycle but that there is no http context.
Essentially, the tool needs for the application to be able to initialize without being run in the actual context of a web site.
It sounds like either that service should be registered with Hybrid lifecycle instead (which allows it to fall back to thread context if there is no http context) or if that is not an option for whatever reason I suppose the code that needs to get that service can only be executed conditionally.
Thanks
Commenting out this line:
GlobalFilters.Filters.Add(ServiceLocator.Current.GetInstance<PopulatePageViewModelActionFilter>());
From our GlobalFiltersInitialization made it to work.
Thanks!
I have just upgraded a site to 7.5 but when I am trying to run the migration tool it failes with this error
Activation error occurred while trying to get instance of type PopulatePageViewModelActionFilter, key ""
at EPiServer.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
at EPiServer.ServiceLocation.ServiceLocatorImplBase.GetInstance[TService]()
at Intra.Web.Framework.Initialization.GlobalFiltersInitialization.Initialize(InitializationEngine context) in c:\TFS\Lernia\Intra\Branches\EPiServer-7.5\Intra.Web\Framework\Initialization\GlobalFiltersInitialization.cs:line 17
at EPiServer.Framework.Initialization.ModuleNode.Execute(Action a, String key)
at EPiServer.Framework.Initialization.InitializationEngine.InitializeModules()
at EPiServer.Framework.Initialization.InitializationEngine.Initialize(HostType hostType)
at EPiServer.Framework.Initialization.InitializationModule.Initialize(HostType hostType)
at EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType)
at VppMigrationTool.Util.SiteProxy.InitalizeEPiServer(String webConfigPath) in d:\Builds\132\EPiServerCMS Modules\VppMigrationTool\Sources\C\TFS\VppMigrationTool\Util\SiteProxy.cs:line 52
at VppMigrationTool.Util.SiteProxy.Initialize(String destinationPath, String virtualDirectory) in d:\Builds\132\EPiServerCMS Modules\VppMigrationTool\Sources\C\TFS\VppMigrationTool\Util\SiteProxy.cs:line 129
at VppMigrationTool.Util.SiteProxy.Initialize(String destinationPath, String virtualDirectory)
at VppMigrationTool.Converter.get_RuntimeProxyWrapper() in d:\Builds\132\EPiServerCMS Modules\VppMigrationTool\Sources\C\TFS\VppMigrationTool\Converter.cs:line 52
at VppMigrationTool.Converter.FillSiteData() in d:\Builds\132\EPiServerCMS Modules\VppMigrationTool\Sources\C\TFS\VppMigrationTool\Converter.cs:line 101
--- Inner exception ---
StructureMap Exception Code: 309
You cannot use the HttpContextLifecycle outside of a web request. Try the HybridLifecycle instead.
at StructureMap.Pipeline.HttpContextLifecycle.findHttpDictionary()
at StructureMap.Pipeline.HttpContextLifecycle.FindCache()
at StructureMap.Pipeline.ObjectBuilder.Resolve(Type pluginType, Instance instance, BuildSession session)
at StructureMap.BuildSession.CreateInstance(Type pluginType, Instance instance)
at StructureMap.BuildSession.CreateInstance(Type pluginType)
at StructureMap.Pipeline.Instance.createRawObject(Type pluginType, BuildSession session)
at StructureMap.Pipeline.Instance.Build(Type pluginType, BuildSession session)
at StructureMap.Pipeline.ConstructorInstance.Get[T](String propertyName, BuildSession session)
at lambda_method(Closure , IArguments )
at StructureMap.Construction.BuilderCompiler.FuncCompiler`1.<>c__DisplayClass2.<CreateBuilder>b__0(IArguments args)
at StructureMap.Construction.InstanceBuilder.BuildInstance(IArguments args)
at StructureMap.Pipeline.ConstructorInstance.Build(Type pluginType, BuildSession session, IInstanceBuilder builder)
at StructureMap.Pipeline.Instance.createRawObject(Type pluginType, BuildSession session)
at StructureMap.Pipeline.Instance.Build(Type pluginType, BuildSession session)
at StructureMap.Pipeline.ObjectBuilder.Resolve(Type pluginType, Instance instance, BuildSession session)
at StructureMap.BuildSession.CreateInstance(Type pluginType, Instance instance)
at StructureMap.BuildSession.CreateInstance(Type pluginType)
at EPiServer.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
I have a demo for the customer this wednesday so I am in a little stress with this not working :(