473,395 Members | 2,222 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,395 software developers and data experts.

ASP.Net and CustomError Handling

I have written a custom dll that I put inside the /bin directory of a
production IIS server. Inside the config file of the web application i have
added the following setting:

<httpModules>
<add name="ExceptionManagerHTTPModule"
type="Digiscribe.HTTPModule.ExceptionManagerHTTPMo dule, HTTPModule" />
</httpModules>

In this dll I have inherited from the IHttpModule which in turn has given me
the ability to trap unhandled exceptions and errors through out the
application. Everything is working great. If an error happens that has not
been handled then this module kicks in and does what I need it to do.
However, on all 404 errors it decides not to work and directs it to a generic
error page "The Resource cannot be found".

When I was working with this application on my local box 404 errors were
handled by my custom dll, once moved to production on a different server,
they are no longer handled. Any help in figuring this out will be greatly
appreciated. Thank you in advance.

Sincerely,
Paul ><>
Nov 18 '05 #1
4 1529
Hi,

try putting a customerrors element in your web.config as follows: -

<customErrors mode = "On" defaultRedirect = "YourDefaultErrorPage.aspx">
<error statusCode = "404" redirect = "Your404HandlerPage.aspx" />
<customErrors/>

HTH
Regards
Joyjit

"Paul" <Pa**@discussions.microsoft.com> wrote in message
news:F3**********************************@microsof t.com...
I have written a custom dll that I put inside the /bin directory of a
production IIS server. Inside the config file of the web application i have added the following setting:

<httpModules>
<add name="ExceptionManagerHTTPModule"
type="Digiscribe.HTTPModule.ExceptionManagerHTTPMo dule, HTTPModule" />
</httpModules>

In this dll I have inherited from the IHttpModule which in turn has given me the ability to trap unhandled exceptions and errors through out the
application. Everything is working great. If an error happens that has not been handled then this module kicks in and does what I need it to do.
However, on all 404 errors it decides not to work and directs it to a generic error page "The Resource cannot be found".

When I was working with this application on my local box 404 errors were
handled by my custom dll, once moved to production on a different server,
they are no longer handled. Any help in figuring this out will be greatly
appreciated. Thank you in advance.

Sincerely,
Paul ><>

Nov 18 '05 #2
Hi Joyjit,

This will work, but not as intended. Paul wants his custom exception handler
to take care of the error so he can do custom stuff.

I too am curious on why this is not working.

-Frank

"Joyjit Mukherjee" <jo**************@hotmail.com> wrote in message
news:eZ**************@TK2MSFTNGP09.phx.gbl...
Hi,

try putting a customerrors element in your web.config as follows: -

<customErrors mode = "On" defaultRedirect = "YourDefaultErrorPage.aspx">
<error statusCode = "404" redirect = "Your404HandlerPage.aspx" />
<customErrors/>

HTH
Regards
Joyjit

"Paul" <Pa**@discussions.microsoft.com> wrote in message
news:F3**********************************@microsof t.com...
I have written a custom dll that I put inside the /bin directory of a
production IIS server. Inside the config file of the web application i have
added the following setting:

<httpModules>
<add name="ExceptionManagerHTTPModule"
type="Digiscribe.HTTPModule.ExceptionManagerHTTPMo dule, HTTPModule" /> </httpModules>

In this dll I have inherited from the IHttpModule which in turn has given me
the ability to trap unhandled exceptions and errors through out the
application. Everything is working great. If an error happens that has

not
been handled then this module kicks in and does what I need it to do.
However, on all 404 errors it decides not to work and directs it to a

generic
error page "The Resource cannot be found".

When I was working with this application on my local box 404 errors were
handled by my custom dll, once moved to production on a different

server, they are no longer handled. Any help in figuring this out will be greatly appreciated. Thank you in advance.

Sincerely,
Paul ><>


Nov 18 '05 #3
I think the result is obvious.
And Joyjit's suggestion is a solution.

It doesn't work for 404 pages becuase your dll is for your web
application, however page 404 is IIS behaviour. Therefore it never
reaches your application when page is not found and as a result it
doesn't load and process your dll. If you need 404 to process your dll,
then you need to refer this in web.config custom error pages as Joyjit
suggested.

--

SevDer
http://www.sevder.com
Paul wrote:
Frank,
That is correct. The first reply will not work because if I put that in
there then my custom dll would not intercept the error and do the custom
processing that I am trying to accomplish.

If anyone else has any ideas I would love to hear them. This is a really
strange behavior that I can not reproduce on my box. Thank you all for
replying and trying to help out...

Paul ><>

"Frank Mamone" wrote:
Hi Joyjit,

This will work, but not as intended. Paul wants his custom exception handler
to take care of the error so he can do custom stuff.

I too am curious on why this is not working.

-Frank

"Joyjit Mukherjee" <jo**************@hotmail.com> wrote in message
news:eZ**************@TK2MSFTNGP09.phx.gbl...

Hi,

try putting a customerrors element in your web.config as follows: -

<customErrors mode = "On" defaultRedirect = "YourDefaultErrorPage.aspx">
<error statusCode = "404" redirect = "Your404HandlerPage.aspx" />
<customErrors/>

HTH
Regards
Joyjit

"Paul" <Pa**@discussions.microsoft.com> wrote in message
news:F3**********************************@micro soft.com...
I have written a custom dll that I put inside the /bin directory of a
production IIS server. Inside the config file of the web application i
have
added the following setting:

<httpModules>
<add name="ExceptionManagerHTTPModule"
type="Digiscribe.HTTPModule.ExceptionManagerHTTPMo dule, HTTPModule"

/>

</httpModules>

In this dll I have inherited from the IHttpModule which in turn has

given

me
the ability to trap unhandled exceptions and errors through out the
application. Everything is working great. If an error happens that has
not
been handled then this module kicks in and does what I need it to do.
However, on all 404 errors it decides not to work and directs it to a
generic
error page "The Resource cannot be found".

When I was working with this application on my local box 404 errors were
handled by my custom dll, once moved to production on a different

server,

they are no longer handled. Any help in figuring this out will be

greatly

appreciated. Thank you in advance.

Sincerely,
Paul ><>


Nov 18 '05 #4
SevDer,

I think you're on the right track but then as stated earlier, the custom dll
will not pick it up.

Maybe you need to disable the 404 default handling in IIS.

Paul maybe you can check the Custom Error tab in IIS on your development
server and see how the 404 is set?

- Frank
"SevDer" <do****@sevder.com> wrote in message
news:ua**************@TK2MSFTNGP14.phx.gbl...
I think the result is obvious.
And Joyjit's suggestion is a solution.

It doesn't work for 404 pages becuase your dll is for your web
application, however page 404 is IIS behaviour. Therefore it never
reaches your application when page is not found and as a result it
doesn't load and process your dll. If you need 404 to process your dll,
then you need to refer this in web.config custom error pages as Joyjit
suggested.

--

SevDer
http://www.sevder.com
Paul wrote:
Frank,
That is correct. The first reply will not work because if I put that in
there then my custom dll would not intercept the error and do the custom
processing that I am trying to accomplish.

If anyone else has any ideas I would love to hear them. This is a really
strange behavior that I can not reproduce on my box. Thank you all for
replying and trying to help out...

Paul ><>

"Frank Mamone" wrote:
Hi Joyjit,

This will work, but not as intended. Paul wants his custom exception handlerto take care of the error so he can do custom stuff.

I too am curious on why this is not working.

-Frank

"Joyjit Mukherjee" <jo**************@hotmail.com> wrote in message
news:eZ**************@TK2MSFTNGP09.phx.gbl...
Hi,

try putting a customerrors element in your web.config as follows: -

<customErrors mode = "On" defaultRedirect = "YourDefaultErrorPage.aspx"><error statusCode = "404" redirect = "Your404HandlerPage.aspx" />
<customErrors/>

HTH
Regards
Joyjit

"Paul" <Pa**@discussions.microsoft.com> wrote in message
news:F3**********************************@micro soft.com...
>I have written a custom dll that I put inside the /bin directory of a
>production IIS server. Inside the config file of the web application i>
>
have
>added the following setting:
>
><httpModules>
> <add name="ExceptionManagerHTTPModule"
> type="Digiscribe.HTTPModule.ExceptionManagerHTTPMo dule, HTTPModule"
>
>
/>
></httpModules>
>
>In this dll I have inherited from the IHttpModule which in turn has
>
>
given
me
>the ability to trap unhandled exceptions and errors through out the
>application. Everything is working great. If an error happens that has>
>
not
>been handled then this module kicks in and does what I need it to do.
>However, on all 404 errors it decides not to work and directs it to a
>
>
generic
>error page "The Resource cannot be found".
>
>When I was working with this application on my local box 404 errors were>handled by my custom dll, once moved to production on a different
>
>
server,
>they are no longer handled. Any help in figuring this out will be
>
>
greatly
>appreciated. Thank you in advance.
>
>Sincerely,
>Paul ><>
>
>


Nov 18 '05 #5

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

Similar topics

2
by: WSeeger | last post by:
When creating a new class, is it encouraged to always include error handling routines within your LET and GET procedures? It's seems that most text books never seem to include much about error...
9
by: Hans-Joachim Widmaier | last post by:
Hi all. Handling files is an extremely frequent task in programming, so most programming languages have an abstraction of the basic files offered by the underlying operating system. This is...
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...
21
by: Anthony England | last post by:
Everyone knows that global variables get re-set in an mdb when an un-handled error is encountered, but it seems that this also happens when the variable is defined as private at form-level. So...
0
by: Cezar | last post by:
Hello, I downloaded and installed the Framework on a server but when I try to run a simple .NET Web application, a simple aspx page with one label, I get this error. The customError tag on...
0
by: Cezar | last post by:
Hi, This is a repost. I installed the framework on a W2K server and when I try to run a simple .net application, an aspx page with a label, I get this Runtime Error: ---- Runtime Error ...
3
by: Stefan Johansson | last post by:
Hi all I'am moving from Visual Foxpro and have a question regarding "best practice" error handling in vb .net. In VFP I have always used a "central" error handling object in order to have a...
4
by: Al Williams | last post by:
Hi, I have error handling in place throughout my application. I also start the application wrapped in error handling code to catch any unexpected exceptions (i.e. exceptions that occur where I...
0
by: Lysander | last post by:
Thought I would give something back with a few articles. This article is a bit of code to add error handling. When I have time, I want to write articles on multilingual databases, and Access...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.