«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:
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(
|
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>