Globalization - Resource File Conflict?

T

TisMe

Hi All,

I am trying to use resource files to globalize my website application.
I had this working fine, working through the API for setting page
titles programatically, with the resource files in /resources

I then started to add declarative code to the web forms to controls
such as buttons and labels, as follows:
<asp:Label ID="lblHowFindOut" runat="server" Text="<%$
Resources:how_did_you_find_out_about_this_site %>" />

This resulted in what amounted to a file not found error - Cant
remember the exact error, sorry! I then discovered that resource files
need to be held in App_GlobalResources, so created the folder and
moved my resource files.

I am now getting the following error:
The resource file '/App_GlobalResources/strings.fr-FR.resx' cannot be
used, as it conflicts with another file with the same name.

I have done the following so far:
- A clean/rebuild
- Searched for files containing, or with fr-fr in the filename
- Renamed my resource files from strings.<culture>.resx to
content.<culture>.resx
- Recreated the solution, added all files apart from resource files
which I created from scratch
- Tried removing the strings.fr-fr.resx file, this gives me the same
error, but related to strings.resx (My default culture - en-GB)

I am still getting the error - Afraid a Google didnt show up anything
useful, and the error although precise is not really helping much.

Worth noting that I am specifically setting the culture based on user
selection, rather than relying on detecting browser setting, although
the error occurs on the home page, before I do anything related to
globalization.

Environment: .Net 3.5; VS 2008; W2003 Ent SP1; SQL Server 2005 Std; IE
6


Any suggestions/solutions/ideas will be very much appreciated!


Thank you,

Simon.
 
T

TisMe

I just solved this one, well - At least discovered a work around. My
problem was centered around the fact that I was using both
ResourceManager.FileBasedResourceManager.

When setting the value declarativey, the pre-compiled assemblies are
used (Created using resgen.exe <path + name of resx file) - This
requires the .resx files to reside in App_GlobalResources folder, in
the root of your site.

When using the API, the actual .resx files are used.

General idea is that you compile the .resx files, then delete them, or
remove them from your site in case you need to add to them later. But,
if I delete them, the API won't work! If I leave them in place, the
original error I report occurs (Resource file blabla cannot be used
because it conflicts with...).

Solution - Compile the .resx files, move them into another folder (I
chose to call it /resources) and have the API reference them from
there.

Complete PITA having to do this, but I'm happy its working now!

If, by chance I have got this all wrong and missed something obvious -
Please do post to let me know. Hope this helps someone else with the
same issue!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top