locked
Change CurrentUICulture Dynamically RRS feed

  • Question

  • User-1187847032 posted

    Hi.

    I'm developing an MVC4 EF C# application. Planned to publish/host it in an Azure Web Site. Just now I did a "VS Express 2012 for the Web Solution Publish" for my most recent build - like I have done so many times before - but this time my application started with the following message:

    Error. An error occurred while processing your request.

    My most recent changes to the application were to introduce Localization i.e. setting the "UICulture" dynamically. This is so people can choose the web site language and have my application load the respective text resource files. If I remove the setting of UICulture from the application and publish it again, it works. Specifically, the line that seems to trigger this message is:

    Thread.CurrentThread.CurrentUICulture = new CultureInfo( CGetUserCulture() );

    CGetUserCulture() is a local function, returning the users preferred language ("EN", "DA", "IS", ... etc). Works in VS 2012. Has anybody come across a similar hurdle, or am I missing somthing?

    Isn't it possible to change the CurrentUICulture in an Azure published web application?

    Regards,
    Markus

    Tuesday, January 15, 2013 10:19 AM

All replies

  • User-1187847032 posted

    Well, I don't really know what to say ...

    This problem occured a week ago, but I posted it today.

    Just now I published the application again - with the CurrentUICulture settings - and now there is no error. The GUI switches languages successfully on the fly.

    Sorry for the fuzz.

    Regards,
    Markus

    Tuesday, January 15, 2013 8:28 PM