I'm updating a CMS6 R1 site from.NET 3.5 to 4.0. Everything seems to work fine, but on site startup I always get this YOD message. If i hit F5 and refresh the page it loads fine, but it seems like the very first request at startup always fails.
Server Error in '/' Application.
ClassFactory not initialized
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: EPiServer.BaseLibrary.ClassFactoryException: ClassFactory not initialized
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
[ClassFactoryException: ClassFactory not initialized]
EPiServer.BaseLibrary.ClassFactory.IsRegistered(Type baseType) +187
[TypeInitializationException: The type initializer for 'EPiServer.CacheManager' threw an exception.]
EPiServer.CacheManager.RuntimeCacheGet(String key) +0
[TypeInitializationException: The type initializer for 'EPiServer.DataAbstraction.UnifiedPathInfo' threw an exception.]
EPiServer.DataAbstraction.UnifiedPathInfo.Load(String path) +495
EPiServer.FileSystem.DefaultAccessControlList..ctor(String path) +71
EPiServer.Web.Hosting.UnifiedDirectory.QueryDistinctAccess(AccessLevel access) +27
EPiServer.Web.Hosting.VirtualPathVersioningProvider.GetDirectory(String virtualPath) +420
EPiServer.Web.Hosting.VirtualPathHandler.InitializeProviders(ProviderSettingsCollection providers, Boolean captureCustomExceptions) +1784
EPiServer.Web.InitializationModule.InitializeVirtualPathProviders(VirtualPathElement vpElement) +158
EPiServer.Web.InitializationModule.Initialize(EPiServerSection config, Settings settings, ConnectionStringSettingsCollection connectionStringSettings) +2069
EPiServer.Web.InitializationModule.Initialize(InitializationEngine context) +31
EPiServer.Framework.Initialization.InitializationEngine.Initialize(HostType hostType) +115
EPiServer.Framework.Initialization.InitializationModule.StaticInitialization(HostType hostType) +200
EPiServer.Framework.Initialization.InitializationModule.Application_BeginRequest(Object sender, EventArgs e) +437
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +270
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
After asking Google, I find that most people seemed to have this issue in CMS 5. The solution back then adding ModuleDependency attributes to modules inheriting from IInitializationModule. But this did not work for me, and the still error remains.
Any suggestions on how to proceed?
It's usually something in your web.config. Check that the upgrade didn't mess with your config's modules and handlers and also double check that the steps described here were followed:
Which type of web server throws the error?
I've put this one on hold for now, but I'll double check the steps in the blog post.
The IIS is 7.5.
I've tried doing the steps in the blog post again, but I still have the same error message.
Additionally, I've tried this nuget package: http://nuget.episerver.com/en/OtherPages/Package/?packageId=EPiServerCMS6ToNetFour without any luck. The same error message persists.
I've also double checked that the correct (CMS6) version of System.ComponentModel.Composition.dll is referenced for projects that have initialization modules.
Edit - Some more info:
<add name="InitializationModule" type="EPiServer.Framework.Initialization.InitializationModule, EPiServer.Framework" preCondition="managedHandler" /> <add name="FirstBeginRequestModule" type="EPiServer.Web.InitializationModule, EPiServer" preCondition="managedHandler" /> <add name="Initializer" type="EPiServer.Scheduler.Initializer, EPiServer.Scheduler" preCondition="managedHandler" /> <add name="WorkflowRuntime" type="EPiServer.WorkflowFoundation.WorkflowSystem, EPiServer.WorkflowFoundation" preCondition="managedHandler" /> <add name="UrlRewriteModule" type="EPiServer.Web.UrlRewriteModule, EPiServer" preCondition="managedHandler" />
I'm running IIS 7.5 with .NET Framework 4 Application Pool in Integrated mode.
Any other suggestions are appreciated!
EPiServer support tipped my that I might need to reinstall all EPiServer programs on my development environment. So I reinstalled CMS, Relate and Composer. After that I haven't had any "ClassFactory" YODs yet, so the issue seems to have been resolved.
Im not sure if it's worth to mention but I noticed that my previous EPiServer Shared (in Windows' Programs & Features list) was version 1.1.454.0, while after reinstalling all EPiServer programs it was 1.1.432.0 (so in fact older). Also, I did not install EPiServer SEO this time around (as this was for testing purposes only).