Tags: Exceptions

«My Settings» throws ArgumentNullException

When moving my blog (yes this blog) from Wordpress to Episerver CMS, I decided to start from scratch. Working with application management, I don't get to do that very often, i.e. never.

Because I started with nothing, I ran in to a few difficulties, and learned a lot along the way. One of the problems was that «My Settings» did not work. Clicking this menu option:

The menu option

Would lead to this:

Server Error in '/' Application.


Value cannot be null.
Parameter name: resourceKey

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: System.ArgumentNullException: Value cannot be null.
Parameter name: resourceKey

Source Error:

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.


Stack Trace:

[ArgumentNullException: Value cannot be null. Parameter name: resourceKey]    EPiServer.Framework.Localization.LocalizationService.GetStringByCulture(
     String resourceKey,
     FallbackBehaviors fallbackBehavior,
     String fallback, CultureInfo culture) +340
   EPiServer.UI.WebControls.TabStrip.LoadPlugIns() +432
   EPiServer.UI.WebControls.TabStrip.OnInit(EventArgs e) +38
   System.Web.UI.Control.InitRecursive(Control namingContainer) +142
   System.Web.UI.Control.InitRecursive(Control namingContainer) +318
   System.Web.UI.Control.AddedControl(Control control, Int32 index) +190
   System.Web.UI.ControlCollection.Add(Control child) +87
   EPiServer.UI.Edit.MySettings.CreateChildControls() +223
   System.Web.UI.Control.EnsureChildControls() +97
   System.Web.UI.Control.PreRenderRecursiveInternal() +42
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +906

 

 

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4210.0

In my web.config I had this piece of configuration that tells Episerver where to find my custom language files to load.

<localization fallbackBehavior="FallbackCulture">
   <providers>
      <add name="languageFiles" 
         virtualPath="~/Resources/LanguageFiles"
         type="EPiServer.Framework.Localization.XmlResources.FileXmlLocalizationProvider, EPiServer.Framework.AspNet" />
   </providers>
</localization>

Adding Echo, MissingMessage and fallbackCulture="en" to the first line, makes Episerver able to load it's internal language resources correctly, and display «My Settings» without errors.

<localization fallbackBehavior="Echo, MissingMessage, FallbackCulture" fallbackCulture="en">
   <providers>
      <add name="languageFiles" 
         virtualPath="~/Resources/LanguageFiles"
         type="EPiServer.Framework.Localization.XmlResources.FileXmlLocalizationProvider, EPiServer.Framework.AspNet" />
   </providers>
</localization>