locked
Server encountered an internal error. For more information, turn off customErrors in the server's .config file. RRS feed

  • Question

  • This is soooo, frustrating!!  After looking through other threads on this subject and trying everything I've found, this is still a problem!

    I am using .NET 2.0, my application server is Windows Server 2003.

    When I make a remote call to my application server an exception is thrown.  My application server logs the error so I know the cause of that problem.  But, the message that displays to the user is "Server encountered an internal error. For more information, turn off customErrors in the server's .config file.", instead of the actual exception text.

    I have already tried the following:

    Added the following to my server <executable name>.config file. (Made no difference)

    <system.runtime.remoting>

    <customErrors mode="Off" />

    </system.runtime.remoting>

    Tried adding the above to machine.config to see if that would help (Made no difference)  <-- Has helped me in .NET 1.1 projects before.

    I have TypeLevelFilter programmatically set to Full (I know this really has no bearing on my problem but I've seen it suggested in other threads). My remoting config is done in code.

    Please help!!

    Thursday, March 8, 2007 12:04 AM

Answers

  • Well, as usual, 5 minutes after posting the question I found the answer!!

    In .NET 2.0 you can set the custom errors mode programmatically using the following :

    RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off;

    This fixed my problem.
    Thursday, March 8, 2007 12:33 AM

All replies

  • Well, as usual, 5 minutes after posting the question I found the answer!!

    In .NET 2.0 you can set the custom errors mode programmatically using the following :

    RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off;

    This fixed my problem.
    Thursday, March 8, 2007 12:33 AM
  •  

    Thank you Mark,

    this really helped me a lot

    Monday, January 28, 2008 11:06 AM
  • Just wanted to thank you as well Mark. I can't help but love those ctrl+c, ctrl+v solutions that magically makes things work :)
    Saturday, July 5, 2008 10:50 PM
  • Nice one. Cheers for posting the answer.
    • Edited by JM82 Tuesday, August 5, 2008 10:25 AM no reason
    Tuesday, August 5, 2008 10:23 AM
  • Is the answer then to not change the .config file because that doesn't work. I too have added these configuration lines and I don't get any more detail. Is the syntax of the 'customErrors' section wrong?

    Thank you.

    Kevin
    Friday, October 31, 2008 6:37 PM
  • Well setting the CustomErrors Off works for me too thru code but not thru the config file...
    I'm all the more curious to know why...

    does anyone have any answers?
    Wednesday, January 14, 2009 8:46 AM
  • Hi sir where did you put this code??
    Wednesday, November 28, 2012 12:28 PM