473,326 Members | 2,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Centralize exception handling

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.
Nov 19 '05 #1
4 1358
> 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

"Atul Bahl" <at******@nospam.com> wrote in message
news:27**********************************@microsof t.com... 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.

Nov 19 '05 #2
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.
"Kevin Spencer" wrote:
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

"Atul Bahl" <at******@nospam.com> wrote in message
news:27**********************************@microsof t.com...
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.


Nov 19 '05 #3
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/aspne...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
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.

"Kevin Spencer" wrote:
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
"Atul Bahl" <at******@nospam.com> wrote in message
news:27**********************************@microsof t.com...
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.


Nov 19 '05 #4
I found this article, with it's code, very useful.

http://msdn.microsoft.com/asp.net/de...html/elmah.asp

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: adi | last post by:
Dear all, This is more like a theoretical or conceptual question: which is better, using exception or return code for a .NET component? I had created a COM object (using VB6), which uses...
7
by: Noor | last post by:
please tell the technique of centralize exception handling without try catch blocks in c#.
3
by: Master of C++ | last post by:
Hi, I am an absolute newbie to Exception Handling, and I am trying to retrofit exception handling to a LOT of C++ code that I've written earlier. I am just looking for a bare-bones, low-tech...
2
by: tom | last post by:
Hi, I am developing a WinForm application and I am looking for a guide on where to place Exception Handling. My application is designed into three tiers UI, Business Objects, and Data Access...
9
by: C# Learner | last post by:
Some time ago, I remember reading a discussion about the strengths and weaknesses of exception handling. One of the weaknesses that was put forward was that exception handling is inefficient (in...
44
by: craig | last post by:
I am wondering if there are some best practices for determining a strategy for using try/catch blocks within an application. My current thoughts are: 1. The code the initiates any high-level...
1
by: Noor | last post by:
Hi all, I am trying to catch all types of exceptions from a app regardless of whether it is in debugger mode( VS development environment) or run the.exe file outside the IDE. My App...
4
by: Ele | last post by:
When Exception handling disabled compiler still spits out "C++ exception handler used." Why is that? Why does it ask for "Specify /EHsc"? Thanks! c:\Program Files\Microsoft Visual Studio...
1
by: George2 | last post by:
Hello everyone, Such code segment is used to check whether function call or exception- handling mechanism runs out of memory first (written by Bjarne), void perverted() { try{
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.