Centralize exception handling

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.
 
K

Kevin Spencer

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
 
G

Guest

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.
 
B

Brock Allen

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).
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top