XmlRoleProvider spontaneously breaks?

Feb 24, 2015 at 7:07 AM
I'm not quite sure what to make of this, but while I was asleep last night, my BlogEngine.NET 3.1.1.0 installation somehow spontaneously stopped working. Restarting had no effect.

I use my own membership and role providers, but I left the standard BlogEngine.NET providers in the configuration file, albeit inactive:
    <roleManager defaultProvider="LegacyRoleProvider" enabled="true" cacheRolesInCookie="false">
      <providers>
        <clear />
        <add name="XmlRoleProvider" type="BlogEngine.Core.Providers.XmlRoleProvider, BlogEngine.Core" description="XML role provider" />
        <add name="SqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="BlogEngine" applicationName="BlogEngine" />
        <add name="DbRoleProvider" type="BlogEngine.Core.Providers.DbRoleProvider, BlogEngine.Core" connectionStringName="BlogEngine" />
        <add name="LegacyRoleProvider" type="ThorarinNet.Legacy.Security.LegacyRoleProvider, ThorarinNet.Legacy" />
      </providers>
    </roleManager>
Out of nowhere, the XmlRoleProvider line if causing the following error:
Configuration Error 

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: Key cannot be null.
Parameter name: key
It worked fine for weeks, but suddenly this error until I comment out the line for the XmlRoleProvider.

Here's a more detailed exception:
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.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList)
   at System.Web.HttpApplication.GetModuleCollection(IntPtr appContext)
   at System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers)
   at System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context)
   at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context)
   at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext)

The type initializer for 'BlogEngine.Core.Right' threw an exception.
   at BlogEngine.Core.Right..ctor()

Key cannot be null.
Parameter name: key (C:\inetpub\blog\web.config line 155)
   at System.Web.Security.Roles.Initialize()
   at System.Web.Security.Roles.RoleExists(String roleName)
   at BlogEngine.Core.Right.InitRightForBlogInstance()
   at BlogEngine.Core.Right.get_RightsByRole()
   at BlogEngine.Core.Right.EnsureBlogInstanceDataLoaded()
   at BlogEngine.Core.Right..cctor()

Key cannot be null.
Parameter name: key
   at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
   at System.Web.Security.MembershipUserCollection.Add(MembershipUser user)
   at ThorarinNet.Legacy.Security.LegacyMembershipProvider.GetAllUsers(Int32 pageIndex, Int32 pageSize, Int32& totalRecords)
   at BlogEngine.Core.Providers.XmlRoleProvider.ReadMembershipDataStore()
   at BlogEngine.Core.Providers.XmlRoleProvider.Initialize(String name, NameValueCollection config)
   at System.Web.Configuration.ProvidersHelper.InstantiateProvider(ProviderSettings providerSettings, Type providerType)
So, it's the type initializer of the Right class throwing the exception all of a sudden. It's happening while my own membership provider gets called by the XmlRoleProvider.

Any ideas as to why this would spontaneously break overnight?