Last post Sep 12, 2006 01:32 PM by kaelaa
Sep 08, 2006 11:43 AM|kaelaa|LINK
I am using resources files in my application to support multiple languages.
I have these resources files in a Resource folder in my web application root :
The application was working great for a few month now until I referenced a new dll to my project.
Now it's giving me this error:
Does anyone knows why it's doing this.
Here's how I'm using my resources files:
In my application_start event in my Global_asax.vb file :
Dim rm As ResourceManager
Application("RM") = ResourceManager.CreateFileBasedResourceManager("Strings", _
Server.MapPath("Resources") & Path.DirectorySeparatorChar, Nothing)
And in the pages that need to read the resource files, here's what I am doing:
In my Page_Init:
rm = Application("RM")
In my Page_load:
Dim st As String = Request.UserLanguages(0)
Dim cookie As HttpCookie = New HttpCookie("Lang")
cookie.Value = st
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(st)
'provide fallback for not supported languages.
Thread.CurrentThread.CurrentCulture = New CultureInfo("fr-ca")
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture
Me.lblMotdePasse.Text = rm.GetString("LoginPage-lblMotdePasse") (Where I'm getting the error !!!)
Me.lblUtilisateur.Text = rm.GetString("LoginPage-lblUtilisateur")
Any help appreciated
Sep 11, 2006 11:48 PM|MilanNegovan|LINK
Sep 12, 2006 01:32 PM|kaelaa|LINK
Thanks for your help,
I actually found the problem.
One of the .msi I installed to install the dll, created a virtual directory called Resources, the same name I was calling my folder
containing all the resource files and it was creating a conflict ...
Anyway , thank you for your help