Hi all,
I am having difficulties with one of my client's website. The website would sometimes go down and gave the following error message:
System.Exception: Unhandled Error: ---> System.TypeInitializationException: The type initializer for 'DotNetNuke.Security.Roles.RoleController' threw an exception. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at System.Collections.ObjectModel.KeyedCollection`2.AddKey(TKey key, TItem item) at System.Collections.ObjectModel.KeyedCollection`2.InsertItem(Int32 index, TItem item) at System.Collections.ObjectModel.Collection`1.Add(T item) at DotNetNuke.ComponentModel.SimpleContainer.AddBuilder(Type contractType, IComponentBuilder builder) at DotNetNuke.ComponentModel.SimpleContainer.RegisterComponentInstance(String name, Type contractType, Object instance) at DotNetNuke.ComponentModel.AbstractContainer.RegisterComponentInstance[TContract](Object instance) at DotNetNuke.ComponentModel.ComponentFactory.RegisterComponentInstance[TContract](Object instance) at DotNetNuke.Security.Membership.DNNRoleProvider..ctor() --- End of inner exception stack trace --- at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture) at DotNetNuke.Framework.Reflection.CreateInstance(Type Type) at DotNetNuke.ComponentModel.SingletonComponentBuilder.CreateInstance() at DotNetNuke.ComponentModel.SingletonComponentBuilder.BuildComponent() at DotNetNuke.ComponentModel.SimpleContainer.GetComponent(IComponentBuilder builder) at DotNetNuke.ComponentModel.SimpleContainer.GetComponent(Type contractType) at DotNetNuke.ComponentModel.AbstractContainer.GetComponent[TContract]() at DotNetNuke.ComponentModel.ComponentFactory.GetComponent[TContract]() at DotNetNuke.Security.Roles.RoleProvider.Instance() at DotNetNuke.Security.Roles.RoleController..cctor() --- End of inner exception stack trace --- at DotNetNuke.Security.Roles.RoleController..ctor() at DotNetNuke.Entities.Portals.PortalInfo.get_AdministratorRoleName() at DotNetNuke.Entities.Portals.PortalSettings.GetPortalSettings(Int32 tabID, PortalInfo portal) at DotNetNuke.Entities.Portals.PortalSettings..ctor(Int32 tabID, PortalAliasInfo objPortalAliasInfo) at DotNetNuke.HttpModules.UrlRewriteModule.OnBeginRequest(Object s, EventArgs e) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) --- End of inner exception stack trace ---
The weird thing is that, it happens on weekends when the traffic is lower (one would expect it to happen on normal business days/hours). We have had this for the past few months and the only solution that could work with this is to restart the application/IIS.
The specs of the server/DNN:
1. DNN version is: 5.4.2
2. Site is self-hosted in their own facility. We have had some problems with the way their network is currently setup but not sure whether that might be the cause of the issue.
Things that we have tried to solve the problem:
1. Made sure there is no duplicate key in database, WebConfig.
2. Deleted the module cache from /Portals/0/module/cache/
3. Made sure the version of .NET (v. 3.5) framework is the same as what DNN requires
4. Made sure that there is no other application in the same Application Pool that uses older .NET framework
Any help is appreciated.
Heindy
|