Solved

Fully exploring exceptions using the Debug Windows

Posted on 2004-04-14
7
218 Views
Last Modified: 2010-04-15
Is it possible to drill down far enough to figure out what an exception message means?

I am guessing the CORE .NET source code is not available to me so I can figure out WHY I am getting an error message and how to work-around the problem?

Sometimes the exception messages I get only tell me the problem....they don't really point to a solution at all or give me any indication of what I could do differently.  So I sit there just feeling lost and very frustrated.

I know that if I set a breakpoint in the Catch block and then start drilling down through the Locals Window variables...I can obtain SOME clues as to what is going on.

I am just wondering if there is something that can help me with debugging?  I am faithfully using Exception Handling....and this actually DOES help me very much....but sometimes it does not seem to help me.

LOL....am I just too stupid to be a programmer?  When I spend hours on a single line of code I start to wonder.  I'm kidding....but the frustration is real.

If there is some big secret to debugging that you gurus know about....please share it with me.  

If spending hours debugging just one or two lines of code is NORMAL in industry....please tell me this also.....so I can align my expectations a little better about how fast I should be putting out code.

Even if I had a few techniques to help shorten the amount of time I spend on a problem that would also be helpful.
0
Comment
Question by:Tom Knowlton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 10825649
try looking at the stack trace of the exception... it wil give you line numbers in your code for where the problem happenned ...

as for other cases most exceptions are pretty clear with what went wrong. i.e. "Argument foo can not be null"
0
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 10825687
The line numbers are not providing me with anything I can work with.

To see the practical application of my question, please visit my OTHER question:

http://www.experts-exchange.com/Programming/Programming_Languages/C_Sharp/Q_20953912.html


Tell me how knowing the line of code helps me solve the problem?  I am willing to learn if someone can explain to me step by step what to do to find the solution.

My sincere thanks!

Tom
0
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 400 total points
ID: 10825845
knowing the line number puts you on the line of code that failed ...

And in your other question ...
You attempted to use an enumerator on something that doesn't support IEnumerable this is fairly clear in the error however these are compile time errors ...
N:\ClientDevelopment\NEO\BuyersFund\WindowsServiceTrackRequestProgress\ServiceTrackRequestProgress.cs(93): foreach statement cannot operate on variables of type 'Outlook.Folders' because 'Outlook.Folders' does not contain a definition for 'GetEnumerator', or it is inaccessible

COMINTEROP Exception thrown inside function ProcessFailures.  Message:  Could not complete the operation because the service provider does not support it.::StackTrace:     at Outlook.NameSpaceClass.get_Folders()
   at WindowsServiceTrackRequestProgress.ServiceTrackRequestProgress.ProcessFailures() in n:\clientdevelopment\neo\buyersfund\windowsservicetrackrequestprogress\servicetrackrequestprogress.cs:line 102
t\neo\buyersfund\windowsservicetrackrequestprogress\servicetrackrequestprogress.cs:line 102

Your other exception sounds to me like the method is throwing an UnImplemented exception
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Assisted Solution

by:RomanPetrenko
RomanPetrenko earned 100 total points
ID: 10825953
You can use anakrino to look in the sources of CORE .NET (not debug, but if you have sources they can explain a lot of problems). It's best tool I've ever see to decompile .NET assemblies...
Look here:
http://www.saurik.com/net/exemplar/
0
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 10826051
Thanks Roman, I'll keep that as an option.

It is looking like I am using the wrong code....based on the other posts you have made in my other questions.

Like I said in my other post, I am using Outlook 2000 and VS .NET 2002.
0
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 11119995
UPDATE:

Well, guess what?

I finally had a major breakthrough on this @!#$^% problem that has been driving me crazy for the last few weeks!!!!!!!


It is a very small change.

Apparently the method   MoveFirst(   ) does not work so well with Exchange.

This was the cause of my COMException:   "Interface not registered" error message this entire time.


The solution is to use    Move(1,0)     instead of MoveFirst(  ).


That's it.   Simple.

This answer came courtesy of Tom Rizzo, an author who was kind enough to correspond with me and help me figure-out finally what the problem was.:

Looking for a good book on programming Exchange, Outlook, ADSI and
SharePoint?  Check out http://www.microsoft.com/MSPress/books/5517.asp

My I also reommend:

.NET and COM: The Complete Interoperability Guide  ISBN:067232170X
http://www.amazon.ca/exec/obidos/ASIN/067232170X/componentsnot-20/701-9386310-4703553
0
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 11120301
More on the MoveFirst problem I described:

http://support.microsoft.com/default.aspx?scid=kb;en-us;273791


If you are getting into Event Sinks....I recommend the following tutorial:

http://www.codeproject.com/csharp/CsManagedEventSinksHooks.asp

Make sure and read the article questions and follow-ups at the bottom!

There are a few caveats.  E-mail me at my Profile e-mail address and we can talk about them.  :)
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question