Re: Custom exception and JIT debugging
From: David Levine (noSpamdlevineNNTP2_at_wi.rr.com)
Date: 08/25/04
- Next message: Robert Jordan: "Re: Changing Appearance of a Minimized Application"
- Previous message: C Newby: "Re: Is there a difference between the C# "int" and System.Int32 ???"
- In reply to: saurabh: "Re: Custom exception and JIT debugging"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 25 Aug 2004 14:15:38 -0500
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.
"saurabh" <saurabh@nagpurcity.net> wrote in message
news:eI6T%23loiEHA.3428@TK2MSFTNGP11.phx.gbl...
> 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
>
> "David Levine" <noSpamdlevineNNTP2@wi.rr.com> wrote in message
> news:ecQtI1XiEHA.1356@TK2MSFTNGP09.phx.gbl...
> > 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?
> >
> > "saurabh" <saurabh@nagpurcity.net> wrote in message
> > news:eAi93rQiEHA.2400@tk2msftngp13.phx.gbl...
> > > 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
> > >
> > >
> >
> >
>
>
- Next message: Robert Jordan: "Re: Changing Appearance of a Minimized Application"
- Previous message: C Newby: "Re: Is there a difference between the C# "int" and System.Int32 ???"
- In reply to: saurabh: "Re: Custom exception and JIT debugging"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|