473,395 Members | 1,797 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.

Catching Framework Errors

My site uses the fairly standard approach of trapping errors in the
Application_Error event and dealing with them there.

However, we occasionally get errors that are generated by the Framework
itself and are this not trappeable by our ASP.Net code.

A good example is if someone requests a page just as the site DLL is
being uploaded, an error such as "Cannot access file XXXXXX as it is
being used by another process" is generated.

These errors are dreadful for a number of reasons.

1). They are butt ugly
2). They contain a plethora of sensitive information including
details like dll name, appBase, drive paths etc etc.
3). They do not appear to be trappeable

MY question is this. How can I catch these pages and deal with them in a
more graceful manner?

I NEED to be able to serve a custom page to my users as this page is a
horror.

Any help would be very gratefully received.

--
Tony G

Nov 17 '05 #1
1 1203
It works, I was able to get to the custom error page when the .dll is
missing
Here is what you have to do

1- in web.confg add the following line, save the file
<customErrors mode="On" defaultRedirect="mycustompage.htm"/>

2- create the mycustompage.htm and place your custom error in there, save
the file

3- remove the .dll of your project from the bin directory

4- Open IE and try to open your project

5- You will get your Custom Error

6- Return the .dll back to the bin Directory of your project

7- Refresh the browser and you still see the custom error

8- Close I.E.

9- Reopen IE and open your Project

10- Back to normal

That's it, you are done

conclusion: ASP.NET looks into your web.config first which is good even if
you have no .dll in your bin directory

any other comments are welcome.

"TonyG" <to********@blueyonder.co.yuk> wrote in message
news:O$**************@tk2msftngp13.phx.gbl...
My site uses the fairly standard approach of trapping errors in the
Application_Error event and dealing with them there.

However, we occasionally get errors that are generated by the Framework
itself and are this not trappeable by our ASP.Net code.

A good example is if someone requests a page just as the site DLL is
being uploaded, an error such as "Cannot access file XXXXXX as it is
being used by another process" is generated.

These errors are dreadful for a number of reasons.

1). They are butt ugly
2). They contain a plethora of sensitive information including
details like dll name, appBase, drive paths etc etc.
3). They do not appear to be trappeable

MY question is this. How can I catch these pages and deal with them in a
more graceful manner?

I NEED to be able to serve a custom page to my users as this page is a
horror.

Any help would be very gratefully received.

--
Tony G

Nov 17 '05 #2

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

Similar topics

1
by: Florian Fredegar Haftmann | last post by:
Hi! I'm working on a tool which helps in testing applications with web-frontends (on Windows) On thing I would like to test ist the occurence of JavaScript errors; the idea is that the test...
8
by: Steinar Bang | last post by:
Is there a way to catch HTTP 4xx and 5xx errors occuring in an IFRAME? I want to replace the blue and white tomcat error pages, with a small discrete text saying "The page currently not available"....
7
by: cmay | last post by:
FxCop complains every time I catch System.Exception. I don't see the value in trying to catch every possible exception type (or even figuring out what exceptions can be caught) by a given block...
9
by: Tim D | last post by:
Hi, I originally posted this as a reply to a rather old thread in dotnet.framework.general and didn't get any response. I thought it might be more relevant here; anyone got any ideas? My...
0
by: R. MacDonald | last post by:
Hi, I have a VB.Net application that dynamically calls unmanaged routines in a DLL that has been created by Fortran (DVF v5). The call to the DLL routine is within a Try/Catch block, but when...
4
by: Nindi | last post by:
Hi I have a scenario with exceptions that I cannot explain. I have an exception class 'MyException' derived from 'std::exception' There are two libraries 'plugin' and 'framework' linked...
4
by: John Pye | last post by:
Hi all I have some C code that is giving me some 'nan' values in some calculations. The C code is wrapped using SWIG to give me a Python module that I am then exercising through a unittest...
4
by: =?Utf-8?B?SmFzb24gUmljaG1laWVy?= | last post by:
Is there a way to catch an application configuration error on startup? I have written a windows service. If there is an error in the configuration file (such as invalid xml) the exception is...
3
by: john | last post by:
I wrapped some fortran code using F2PY and need to be able to catch fortran runtime errors to run the following: # "grid" is a wrapped fortran module # no runtime errors incurred when run with...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.