AI OnAI Off
Check your implementation of PS.CMS.Business.Channels.DisplayResolutionBase.Translate(resurceKey), what is your resurceKey? does it exists in resoucefiles?
Or change your implementation of Translate to
private string Translate(string resurceKey) { string value; if(!LocalizationService.Service.TryGetString(resurceKey, out value)) { value = resurceKey; } return value; }
Are you using a custom language? without any localization of the display.xml (standard)
That is my implementation of Translate and no, we are not using any custom languages. We started with the Alloy site and have not really changed any of the underlying code.
yeah strange, only in prod huh? try to catch ThrowInvalidOperationException and log the message/CultureInfo.CurrentUICulture/resurceKey <-- nice spelling
Below is the error that occurs after I update the code for our CMS system. Today I had minimal changes and a lot of SS/JS updates and after I published the site it worked for about 5 minutes and then starting getting this error. It seems to be around the resolution or localization (see bolded part below) everytime I see this. This occurs after most deployments, I have reset App pool and the website and that does not work. But after stop/start of the entire IIS server it seems to work okay. This cannot be a long term solution - We are on a development box right now but I need to resolve this soon. We are on version 10.3
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 2/22/2017 3:36:39 PM
Event time (UTC): 2/22/2017 8:36:39 PM
Event ID: df5ae89eb3d949b1846ec9df5ba4af73
Event sequence: 1
Event occurrence: 1
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/1/ROOT-10-131322693953235238
Trust level: Full
Application Virtual Path: /
Application Path: xxxxx
Machine name: xxx-xxx-xxxxxx
Process information:
Process ID: 8904
Process name: w3wp.exe
Account name: IIS APPPOOL\DefaultAppPool
Exception information:
Exception type: TargetInvocationException
Exception message: Exception has been thrown by the target of an invocation.
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
at System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args)
at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context)
at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext)
Initialize action failed for Initialize on class EPiServer.Initialization.Internal.CmsCoreInitialization, EPiServer, Version=10.3.0.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7b__7_0(InitializationEngine e) >
at EPiServer.Framework.Initialization.InitializationEngine.InitializeModules()
at EPiServer.Framework.Initialization.InitializationEngine.ExecuteTransition(Boolean continueTransitions)
at EPiServer.Framework.Initialization.InitializationEngine.Initialize()
at EPiServer.Framework.Initialization.InitializationModule.<>c.
at EPiServer.Framework.Initialization.InitializationModule.EngineExecute(HostType hostType, Action`1 engineAction)
at EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType)
at EPiServer.Global..ctor()
at PS.CMS.EPiServerApplication..ctor()
at ASP.global_asax..ctor() in c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\0101cf72\e5f8eef1\App_global.asax.yhewydvr.0.cs:line 0
Activation error occurred while trying to get instance of type StandardResolution, key ""b__0() >
at EPiServer.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
at EPiServer.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType)
at EPiServer.Initialization.Internal.CmsCoreInitialization.InitializeDisplayOptionsAndResolutions(InitializationEngine context)
at EPiServer.Initialization.Internal.CmsCoreInitialization.Initialize(InitializationEngine context)
at EPiServer.Framework.Initialization.Internal.ModuleNode.<>c__DisplayClass3_0.
at EPiServer.Framework.Initialization.Internal.ModuleNode.Execute(Action a, String key)
at EPiServer.Framework.Initialization.Internal.ModuleNode.Initialize(InitializationEngine context)
at EPiServer.Framework.Initialization.InitializationEngine.InitializeModules()
Error while building type PS.CMS.Business.Channels.StandardResolution. See the inner exception for details
1.) new StandardResolution()
2.) PS.CMS.Business.Channels.StandardResolution
3.) Instance of PS.CMS.Business.Channels.StandardResolution
4.) Container.GetInstance(PS.CMS.Business.Channels.StandardResolution)
at lambda_method(Closure , IBuildSession , IContext )
at StructureMap.Building.BuildPlan.Build(IBuildSession session, IContext context)
at StructureMap.BuildSession.BuildNewInSession(Type pluginType, Instance instance)
at StructureMap.Pipeline.NulloTransientCache.Get(Type pluginType, Instance instance, IBuildSession session)
at StructureMap.BuildSession.ResolveFromLifecycle(Type pluginType, Instance instance)
at StructureMap.SessionCache.GetObject(Type pluginType, Instance instance, ILifecycle lifecycle)
at StructureMap.SessionCache.GetDefault(Type pluginType, IPipelineGraph pipelineGraph)
at StructureMap.Container.GetInstance(Type pluginType)
at EPiServer.ServiceLocation.StructureMapServiceLocator.DoGetInstance(Type serviceType, String key)
at EPiServer.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
Collection was modified; enumeration operation may not execute.
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
at System.Collections.Generic.List`1.Enumerator.MoveNext()
at EPiServer.Framework.Localization.ProviderBasedLocalizationService.LoadString(String[] normalizedKey, String originalKey, CultureInfo culture)
at EPiServer.Framework.Localization.LocalizationService.TryGetStringByCulture(String originalKey, String[] normalizedKey, CultureInfo culture, CultureInfo fallbackCulture, String& localizedString)
at EPiServer.Framework.Localization.LocalizationService.TryGetStringByCulture(String originalKey, String[] normalizedKey, CultureInfo culture, String& localizedString)
at EPiServer.Framework.Localization.LocalizationService.TryGetStringByCulture(String resourceKey, CultureInfo culture, String& localizedString)
at PS.CMS.Business.Channels.DisplayResolutionBase.Translate(String resurceKey)
at PS.CMS.Business.Channels.DisplayResolutionBase..ctor(String name, Int32 width, Int32 height)
at PS.CMS.Business.Channels.StandardResolution..ctor()
at lambda_method(Closure , IBuildSession , IContext )
Request information:
Request URL: xxxxxxxx/
Request path: /
User host address:xxxxxx
User:
Is authenticated: False
Authentication Type:
Thread account name: IIS APPPOOL\DefaultAppPool
Thread information:
Thread ID: 27
Thread account name: IIS APPPOOL\DefaultAppPool
Is impersonating: False
Stack trace: at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
at System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args)
at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context)
at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext)
Custom event details: