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 / October 2006

Tip: Looking for answers? Try searching our database.

get variable that involve with exception

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mtczx232@yahoo.com - 13 Oct 2006 14:57 GMT
have a way to get the variables (and values) that involve with
exception from exception object?
have a way to know the specific address where exception fire in the
code?
(the stack call give only the mathod, not specific line or command
that fire the exception).
Chris Fulstow - 13 Oct 2006 15:32 GMT
Exception.StackTrace should give you some of that information if you're
running in Debug mode.

http://msdn2.microsoft.com/en-us/library/system.exception.stacktrace.aspx

> have a way to get the variables (and values) that involve with
> exception from exception object?
> have a way to know the specific address where exception fire in the
> code?
>  (the stack call give only the mathod, not specific line or command
> that fire the exception).
mtczx232@yahoo.com - 15 Oct 2006 02:16 GMT
> Exception.StackTrace should give you some of that information if you're
> running in Debug mode.
[quoted text clipped - 7 lines]
> >  (the stack call give only the mathod, not specific line or command
> > that fire the exception).

if you read my question we not get more bla bla on the internet.
my claim is very simple! the StackTrace is not give us any idea what
line of code make the exception.

for example:

  private sub xx()
     ..
     dim s as string=b.toString()  //the b is null, so it's throw
exception
     ..
  end sub

So  now we see how is difficult to know witch line make the problem and
witch var is null!

have solution for this problam?
Carl Daniel [VC++ MVP] - 15 Oct 2006 05:06 GMT
>> Exception.StackTrace should give you some of that information if
>> you're running in Debug mode.
[quoted text clipped - 25 lines]
>
> have solution for this problam?

As Chris already indicated, if you're runing a debug build then the stack
trace from the exception will tell you the file name and line number where
the exception was thrown.  If you're not running a debug build, then you'll
only get the function name.

That's all there is - there ain't no more.

-cd
mtczx232@yahoo.com - 15 Oct 2006 17:52 GMT
what you mean, debug build is running from VS? if is true what we do on
the customer place?

We face day after day with this problem! the Program compile yet under
debug profile and deliver to customer for debugging session. the
customer call about bugs, but the max Info is name of procedure . I
very wonder why Microsoft not give us more info for this session! it's
very simple to add to exception more info about the line on source (I
know about the code version problem), and add the CLI code thet make
the problem.

the real thing is, that since microsoft and third's parties give us
Decompilers, there no problam to add to exception viewer the source
code from CLI code itself, without need to keep track after versions of
source codes that belong to this CLI.

I see demostrasion of AVIcode product that collect such info on each
exception. I wonder, if exception not include this info, How Avicode
collect it? I not think that Avicode change or replace fuction from
Framwork or change the code that JIT make from CLI?

So I can get the CLI code with the command that make the exception?

Rate this thread:







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.