Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / August 2004

Tip: Looking for answers? Try searching our database.

Custom exception and JIT debugging

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
saurabh - 23 Aug 2004 13:16 GMT
Hello All,

In my application I have created a custom exception class derived from
ApplicationException. For a particular error condition, I throw this
exception. In the calling code, I catch this exception and report the error
condition. This all works fine on my development machine (as always ;)) but
on the release machine, the exception is not reported but it launches the
JIT debugger nasty dialog saying 'unhandled exception'

Has anybody experienced anything like this? Any help in resolving this issue
is highly appreciated.

TIA,

--Saurabh
David Levine - 24 Aug 2004 02:54 GMT
Is this all housed within a single assembly, or is the assembly that the
exception is defined different then the assembly that catches it? Also, what
does the stack trace say?

> Hello All,
>
[quoted text clipped - 11 lines]
>
> --Saurabh
saurabh - 25 Aug 2004 10:54 GMT
They are in different assemblies. The stack trace is exactly same as I get
in the exception object on my development machine. Can you tell me under
what conditions the JIT debugger thinks it needs to kick in?

--Saurabh

> Is this all housed within a single assembly, or is the assembly that the
> exception is defined different then the assembly that catches it? Also, what
[quoted text clipped - 18 lines]
> >
> > --Saurabh
Andy Becker - 25 Aug 2004 16:36 GMT
> They are in different assemblies. The stack trace is exactly same as I get
> in the exception object on my development machine. Can you tell me under
> what conditions the JIT debugger thinks it needs to kick in?
>
> --Saurabh

Only an unhandled exception, I believe.  Do you have a global error handler,
i.e. on the current thread?

Best Regards,

Andy
David Levine - 25 Aug 2004 20:15 GMT
Assuming all things being equal you should get the same fundamental behavior
regardless of the build type. IOW, if it's unhandled in a release build it
should be unhandled in a debug build.  How the system responds to an
unhandled exception may differ between builds but not whether it is
unhandled or handled in a catch handler.

That implies that you may be seeing an artifact of the environment, i.e. the
debug environment may be different then the release environment; e.g. where
the assemblies are located may be different. This can cause problems in the
client code that catches the exception. When the exception is caught the
runtime must be capable of resolving the type by locating the assembly the
type is defined in. If the type used in the client is defined in an assembly
located in a different directory then the assembly used in the server code
that throws the exception then the runtime will treat them as two distinct
types. In this case the catch block will either not catch the exception
(resulting in an unhandled exception), or when it tries to deserialize or
access the exception object it may cause a TypeCast exception, or some other
exception, nested within the original exception.

So I would look for duplicate copies of the assembly that defines the custom
exception. If you have more then 1 copy that the client can bind to it could
cause this problem.

> They are in different assemblies. The stack trace is exactly same as I get
> in the exception object on my development machine. Can you tell me under
[quoted text clipped - 26 lines]
> > >
> > > --Saurabh

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.