httpModule for Unhandled Exceptions

G

Guest

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?
 
W

Walter Wang [MSFT]

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 ([email protected], 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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top