httpModule for Unhandled Exceptions

Discussion in 'ASP .Net' started by =?Utf-8?B?Q2h1Y2sgUA==?=, Feb 1, 2007.

  1. I am writing an httpModule for unhandled exceptions.
    I want to log what application the error occured in.
    Normally in 1.x I would do this by getting the AssemblyName associated with
    the executing assembly.

    In 2.0 this comes up as app_web_x213
    which is not real helpful. This is probably the dll that asp.net 2.0
    compiled the page to.

    What's the best way to figure out the name of the app that had the exception?
     
    =?Utf-8?B?Q2h1Y2sgUA==?=, Feb 1, 2007
    #1
    1. Advertising

  2. Hi Chuck,

    ASP.NET 2.0 introduced new compilation model which creates separate
    assemblies for the contents of the App_Code directory as well as the
    global.asax file (if present), and then compiles all of the .aspx files in
    each directory into a separate assembly. (If pages in the same directory
    are authored in different languages or if they have dependencies on each
    other through an @ Reference directive, they could also end up in separate
    assemblies.) User controls and Master Pages are also typically compiled
    independently from .aspx pages. It is also possible to configure the
    App_Code directory to create multiple assemblies if, for example, you
    wanted to include both Visual Basic? and C# source code in a project.

    You will have two options to make your logging functionality has meaningful
    AssemblyName as you did in 1.1:

    1) Use Web Deployment Project add-on
    (http://msdn2.microsoft.com/en-us/asp.net/aa336619.aspx). This will compile
    and merge your Web Site into a single assembly.

    2) Use Web Application Project add-on (available in VS2005 SP1 or download
    standalone from http://webproject.scottgu.com/). This will use the same
    model as in 1.1 for web project.

    Hope this helps.



    Sincerely,
    Walter Wang (, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications. If you are using Outlook Express, please make sure you clear the
    check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
    promptly.

    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscriptions/support/default.aspx.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Walter Wang [MSFT], Feb 2, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. terry

    Unhandled Exceptions & Framesets

    terry, Jul 2, 2003, in forum: ASP .Net
    Replies:
    5
    Views:
    446
    Bassel Tabbara [MSFT]
    Jul 3, 2003
  2. Replies:
    1
    Views:
    414
    Darren Kopp
    Mar 7, 2006
  3. Alan Silver

    How do I catch unhandled exceptions

    Alan Silver, Mar 20, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    1,762
    Alan Silver
    Mar 23, 2006
  4. Winista

    Unhandled Exceptions thrown

    Winista, Mar 22, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    409
    Winista
    Mar 22, 2006
  5. Warren Tang
    Replies:
    1
    Views:
    918
    Warren Tang
    Sep 23, 2008
Loading...

Share This Page