locked
Service unavailable after adding languages? RRS feed

  • Question

  • User1289595697 posted

    Hello,

    After adding new resource files to my web application, I noticed that my website often gives 'service unavailable' errors. I didn't get these before, so I think this could be because of the new resources. Is this possible, is this a known issue? I can fix this by restarting the plesk services (no idea how this fixes this, though), but the error often returns after a while.

    If this is related to the localization, what could be done about this? (site's framework version is 1.1)

    Thanks in advance!

    Dave

    Saturday, January 27, 2007 8:13 AM

Answers

  • User113421904 posted

    Hi

    Service Unavailable is usaullay because of application pool crash. So I'm wondering if the resource file is corrupt, is your resource file genetate dynamically by your asp.net web application?

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, January 28, 2007 10:05 PM
  • User113421904 posted

    ((System.Web.UI.WebControls.Image)item.FindControl("imgLogo")).ToolTip = LocRM.GetString("image_logo"); 

    <asp:label id="lblCyclistAge" runat="server" cssclass="normal" text='<%# string.Format(LocRM.GetString("text1"), DataBinder.Eval(Container.DataItem, "info")) %>'></asp:label>
     

    Hi,

    You can replace it with some string one by one, the test result might help me narrow down the issue.

    ((System.Web.UI.WebControls.Image)item.FindControl("imgLogo")).ToolTip = "some string";

    <asp:label id="lblCyclistAge" runat="server" cssclass="normal" text='<%# "some other string", DataBinder.Eval(Container.DataItem, "info")) %>'></asp:label>
     
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 31, 2007 9:30 PM

All replies

  • User1289595697 posted

    The error in the event viewer says the following:

    The description for Event ID ( 0 ) in Source ( .NET Runtime ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: .NET Runtime version 1.1.4322.2300- Setup Error: Failed to load resources from resource file

    Please check your Setup.

    Saturday, January 27, 2007 8:59 AM
  • User1289595697 posted

    Talking to myself here, lol

    After some googling, I found that it could be because of a stack overload. The only thing I can think of that could cause it is the following code:

     

    Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Request.UserLanguages[0]);
    Thread.CurrentThread.CurrentUICulture = new CultureInfo(Request.UserLanguages[0]);
      

    Could it be possible that this gives the overload? Like when a visitor's culture has no matching resource, perhaps?

    Saturday, January 27, 2007 12:39 PM
  • User113421904 posted

    Hi

    Service Unavailable is usaullay because of application pool crash. So I'm wondering if the resource file is corrupt, is your resource file genetate dynamically by your asp.net web application?

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, January 28, 2007 10:05 PM
  • User1289595697 posted

    Yes it was. But I kept getting the error, even when I removed all extra languages (keeping the original English).

    What I did was revert the most frequently visited pages back to how they were (language 'hardcoded'), and now the error does not appear anymore. So it must be something I did in the code, although I don't know what. And I also know now that some statements only work when the language is hardcoded, but not with resources.

    Some of the statements:

    This sets the image tooltip in a datagrid:

    ((System.Web.UI.WebControls.Image)item.FindControl("imgLogo")).ToolTip = LocRM.GetString("image_logo"); 
    This does string formatting in the HTML: 
    
     
    
    <asp:label id="lblCyclistAge" runat="server" cssclass="normal" text='<%# string.Format(LocRM.GetString("text1"), DataBinder.Eval(Container.DataItem, "info")) %>'></asp:label>
     
    These are just some examples, but like I said, I don't know which code creates the error. I just replaced all the LocRM.GetString parts with hardcoded text, and now it works.	
    Monday, January 29, 2007 4:31 AM
  • User113421904 posted

    ((System.Web.UI.WebControls.Image)item.FindControl("imgLogo")).ToolTip = LocRM.GetString("image_logo"); 

    <asp:label id="lblCyclistAge" runat="server" cssclass="normal" text='<%# string.Format(LocRM.GetString("text1"), DataBinder.Eval(Container.DataItem, "info")) %>'></asp:label>
     

    Hi,

    You can replace it with some string one by one, the test result might help me narrow down the issue.

    ((System.Web.UI.WebControls.Image)item.FindControl("imgLogo")).ToolTip = "some string";

    <asp:label id="lblCyclistAge" runat="server" cssclass="normal" text='<%# "some other string", DataBinder.Eval(Container.DataItem, "info")) %>'></asp:label>
     
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 31, 2007 9:30 PM