3

I have been developing an application in classic ASP.NET and deploying it to azure. Until now, no problem at all. Now I want to add localized resources to support multi-language.

The App_GlobalResources/*.resources files works fine when running local, both outside and inside the azure emulator. But when I try to use them in Azure, I'm getting the following error:

Could not find any resources appropriate for the specified culture (or the neutral culture) on disk. baseName: SistemaRRHH.Signup.SignupLabels locationInfo: fileName: SistemaRRHH.Signup.SignupLabels.resources.

The exception is very self-explanatory, buy I can't solve it in any way.

The exception is thrown here:

var requestCultureInfo =  new CultureInfo(Utils.GetRequestFirstLanguageAccepted(Request.Headers["Accept-Language"]));

ResourceManager rm = ResourceManager.CreateFileBasedResourceManager(Constants.RESOURCE_FILE_LABELS_NAME, HttpContext.Current.Server.MapPath(Constants.RESOURCE_FILE_DIRECTORY), null);

letsGetItStartedLabel.Text = rm.GetString(Constants.LETS_GET_IT_STARTED_LABEL, requestCultureInfo);

Thanks a lot for your help!

Adi
  • 5,089
  • 6
  • 33
  • 47
lokip1
  • 31
  • 2

1 Answers1

0

I've noticed some localisation issues within Azure, specifically with DateTimes (the usual culprit) - are you based outside of the US? We're based in the UK and using a European Data Centre but still getting US-formatted dates within Azure. If that is the case, you could try creating en-US resource files as well to see if that fixes the issue. We added a globalization tag into the web.Config for now - a short term fix but gets past the issue until I can revisit.

levelnis
  • 7,665
  • 6
  • 37
  • 61
  • Actually we are based in Chile but for now we are handling the localization using the Accept-Language header at the HTTP Request . We have created files to: English: SistemaRRHH.Signup.SignupLabels.en-US.resources Spanish: SistemaRRHH.Signup.SignupLabels.es-ES.resources Default: SistemaRRHH.Signup.SignupLabels.resources In theory, .NET should get the resources from the Default file if it doesn't match any other, but I think it's not finding ANY of the files. Thanks anyway @levelnis, if I find the solution I'll post it here. – lokip1 Nov 28 '12 at 15:47