Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 3 of 3

Thread: GlobalErrorHandler

  1. #1
    gorgonmedusa is offline Junior Member
    Join Date
    Jun 2009
    Posts
    3

    Default GlobalErrorHandler

    I know I've read the use of this class isn't supported, but there's nice goodies in there I'd like to use. Having trouble implementing it. In debug, I can get the module to fire on an application error, but when the OnError event instantiates the Handler object, it never hits the HandleException method and just goes to the typical error message.

    Tried changing customErrors on and off, but doesn't seem to change anything. Yes, I added all the items to the web.config suggested in the comments of that class file. Ideas?

    Thanks!

  2. #2
    96spec is offline Member
    Join Date
    Apr 2009
    Posts
    76

    Default

    We were thinking of trying this out too, found a quick writeup on setting it up, you might want to take a look...
    http://www.comptoncontrols.com/Globa...ler/Readme.txt

  3. #3
    96spec is offline Member
    Join Date
    Apr 2009
    Posts
    76

    Default Got this working now...

    Took a little configuring and some code changes but got this to work now. It should work regardless if customErrors is set to On or Off. Attach the debugger and set your breakpoint to the application OnError event. It will hit the typical error message when you're on development first and just click on the debugger continue icon, which will step into the ueh.HandleException method.

    One key note though, the configuration example shown on the Handler.cs is just a small subset of the app keys you need to make this work. You'll need to include the other items such as "LogToEventLog", "LogToFile", etc. Otherwise it will throw an exception and if you walk through the debugger at that point you'll see why because of the way ASDNSF calls their Config.GetString methods.

    Finally if you're sending your notification through email. Make sure you include this before sending the message, otherwise you will get a "the server response was: 5.7.1" :

    client.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;
    client.Send(msg);