tags:

views:

761

answers:

3

We're developing an EPiServer-based website and trying to deploy our latest build onto a WinXP IIS6 box.

When browsing to site, we're getting the following stack trace

[ClassFactoryException: ClassFactory not initialized] EPiServer.BaseLibrary.ClassFactory.get_Instance() +123 EPiServer.BaseLibrary.Context.get_Repository() +14 EPiServer.WorkflowFoundation.StorageProviders.ObjectStoreStorageProvider.VerifyCommonSchemas() +15 EPiServer.WorkflowFoundation.AspNetWorkflowManager.get_StorageProvider() +44 EPiServer.WorkflowFoundation.AspNetWorkflowManager.Initialize(Boolean lazyLoading) +589 EPiServer.WorkflowFoundation.AspNetWorkflowManager.get_InstanceHandler() +16 EPiServer.WorkflowFoundation.Workflows.ApprovalService..ctor() +93

[TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0 System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +103 System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +261 System.Activator.CreateInstance(Type type, Boolean nonPublic) +66 EPiServer.WorkflowFoundation.WorkflowSystem.RegisterServices(IWorkflowManager manager, WorkflowSettingsElement configuration) +338 EPiServer.WorkflowFoundation.WorkflowSystem.Init(HttpApplication context) +240 System.Web.HttpApplication.InitModules() +267 System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +1251 System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +243 System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +106 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +214

I've googled it, and visited the EPiServer forums, but I've not found any concrete suggestions or solutions. Has anyone else out there run into this?

Ross

A: 

I am going out on a limb and guessing here, but did you by chance do development on EPiServer 5 SP 2 and deploy on EPiServer 5 SP 3?

In EPiServer 5 SP3 there was some remodelling in how a EPiServer handles the initialization of the application. These changes made it so that it's not possible to hook into the datafactory events in Application_Start. Instead you need to first hook into Application_FirstBeginRequest and then we have a instance of the DataFactory to work with.

Suggested reading

aanund
+1  A: 

The configuration file is written for IIS7 but you build in webserver in Studio want a IIS6 sonfig file. I have wrote abut this in ny EPiServer notes http://epiwiki.se/troubleshooting/classfactory-not-initialized

A: 

Definitely sounds like a configuration error. As Mattias said, the default web.config is for IIS7. This can cause problems when running IIS6 or Cassini.

Ted Nyberg