Centralize exception handling

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

We want to use one static class that can be called from anywhere in
application and provides all the notification mechanism behind the scenes and
can be used to handle exceptions all over the application like 'try & catch'.

Now the problem is we are getting the Error :
'System.Web.Management.WebBaseEvent(string, object, int, System.Exception)'
is inaccessible due to its protection level.

Or any other way to centralize the exception handling.

Many thanks in advance.
 
Now the problem is we are getting the Error :
'System.Web.Management.WebBaseEvent(string, object, int,
System.Exception)'
is inaccessible due to its protection level.

.... and what IS it's protection level? If I were to guess (and I hate
guessing) I would guess "Protected." Try making it "Public" instead.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
The sun never sets on
the Kingdom of Heaven
 
I am not overiding the method by writing an custom webbased event handler,
currently I am just using

System.Web.Management.WebBaseEvent error = new
System.Web.Management.WebBaseEvent(sb.ToString, null, Guid.NewGuid, 1);
System.Web.Management.WebBaseEvent.Raise(error);

inside the catch block.
 
The typical model when using WebEvents is derive your own and come up with
yor own EventID (1 is not going to be very good, as it's in the reserved
range). Here's the QuickStart that goes into more detail:

http://beta.asp.net/QUICKSTART/aspnet/doc/monitoring/webevents.aspx

In this sample they use event code 200001, which is not such a good idea
either. You should use WebEventCodes.WebExtendedBase and then add an offset
to that (1 will do in this case).

-Brock
DevelopMentor
http://staff.develop.com/ballen
 
Back
Top