User-1591584071 posted
I'm trying to implement a multi-language solution into a website. Currently the website will only be in Dutch. More languages will follow in the future.
Web.Config:
<system.web>
<compilation
debug="true" />
<globalization
culture="nl-NL"
uiCulture="nl-NL" />
</system.web>
Global.asax:
void Application_OnStart()
{
Application["resourceManager"] =
ResourceManager.CreateFileBasedResourceManager("Resource", Server.MapPath("App_GlobalResources"),
null);
}
MyPage.aspx.cs:
protected
ResourceManager resourceManager;
protected void Page_Init(object sender,
EventArgs e)
{
resourceManager = (ResourceManager)Application["resourceManager"];
}
MyPage.aspx:
<%=resourceManager.GetString("copyright")%>
In App_GlobalResources I've created _Resource.nl-NL.resx which I compile into Resource.nl-NL.resources. Most of the time it runs fine, but sometimes I get the following
error message:
Server Error in '/' Application.
Could not find any resources appropriate for the specified culture (or the neutral culture) on disk.
baseName: Resource locationInfo: <null> fileName: Resource.resources
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.Resources.MissingManifestResourceException: Could not find any resources appropriate for the specified culture (or the neutral culture) on disk.
baseName: Resource locationInfo: <null> fileName: Resource.resources
Creating Resource.resources doesn't fix the problem. The error is still shown.
Does anyone know what I'm doing wrong here?