How do you debug when nothing happens?

11 posts, 0 answers
  1. robert hutchison
    robert hutchison avatar
    17 posts
    Member since:
    Feb 2010

    Posted 18 Apr 2010 Link to this post

    It seems that so many times when I make some error in the xaml, the result is that I get a blank screen or the control just doesn't show up. It doesn't seem to leave any traces of what problem it was having around, or post an error to the event log, or raise an error or leave any other clues to help me find out what the problem was. ...or am I missing something? ...besides staring at a page of code until I see that typo (which can sometimes take me hours (or longer) if Intellisense doesn't help me out). The testing tools seem like a good idea, but they always say "point at what you want to inspect". Well, that wouldn't work, because the behavior is always the same - if you make any mistake, absolutely nothing will happen and nothing will be left behind to help you realize what you did wrong.  ...or am i missing something big and wonderful?
  2. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 19 Apr 2010 Link to this post

    Silverlight 4 is supposed to remedy this situation considerably. The error messages from the XAML parser will in most cases be a lot more detailed. Here is some info on the new parser:

    http://www.jeff.wilcox.name/2010/03/silverlight4-new-parser/


  3. DevCraft banner
  4. robert hutchison
    robert hutchison avatar
    17 posts
    Member since:
    Feb 2010

    Posted 19 Apr 2010 Link to this post

    Hi,

    Thanks, but I am using Silverlight 4 (released version), Visual Studio 2010 (released version) and it doesn't seem any better to me. It still just sits there. I was hoping it would leave a remnant or two somewhere. ...or maybe it is and I am just missing it...

    Thanks,
    Rob
  5. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 19 Apr 2010 Link to this post

    Sorry, I may have misunderstood your question. Are you talking about the error messages in the browser or in the VS designer surface? Xaml parser error messages in the browser are usually reported as javascript errors. But if you are talking about the design surface I am not sure.
  6. robert hutchison
    robert hutchison avatar
    17 posts
    Member since:
    Feb 2010

    Posted 19 Apr 2010 Link to this post

    Well, both really. If I could get a hint from anywhere, I would be happy. As it is, the design surface gives no help and when you run it, there is no help either.

    If an error occurs at runtime, there is nothing to help you find out what happened. There is no browser error, no runtime error, no system event, no trace file, nothing in the procmon output, nothing to point at (so a testing tool won't help) - just nothing. Am I the only one that experiences this?
  7. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 19 Apr 2010 Link to this post

    Are you not seeing anything in the browser status bar? A javascript error is usually reported as a yellow exclamation mark (in IE anyway). If you click on that you should get more details about the error.
  8. robert hutchison
    robert hutchison avatar
    17 posts
    Member since:
    Feb 2010

    Posted 19 Apr 2010 Link to this post

    Nope - nothing. This happens very frequently; I am surprised nobody else gets these - I get them all the time.

    IE doesn't detect them, nor does Firefox, nor does Chrome. No error of any kind is reported to the best of my knowledge anywhere. I've also looked in the developer tools of each of these browsers and don't see any errors and have tried profiling and tracing and no errors are reported. 
  9. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 20 Apr 2010 Link to this post

    That is strange. I do not think I have seen errors like that. The only thing I can think of is that there might be something wrong with the error handling code in App.xaml.cs (generated by VS). Try setting a breakpoint in the Application_UnhandledException handler in App.xaml.cs and see if it stops there when the error occurs.
  10. Michael
    Michael avatar
    3 posts
    Member since:
    Feb 2008

    Posted 20 Apr 2010 Link to this post

    In the past I have used the UnhandledException event in App.xaml.cs to the debug XAML parsing exceptions.  In the handler for the event, you can force the debugger to the stop so that you can examine the exception. 

    Regards,

    Michael
  11. robert hutchison
    robert hutchison avatar
    17 posts
    Member since:
    Feb 2010

    Posted 20 Apr 2010 Link to this post

    Well, that would work if any exception was generated, but it never is or if it is, it is being ignored inside the control. OK, perhaps an example or two.

    Example 1: I have a RadGridView that, when you expand a row, a panel displays a bunch of information on a panel (sort of like the basic demo). If the Image control has a problem with the image, all you see is a white box. If you gave it a bad pathname, you would get an error, but there are lots and lots of other "mistakes" you can make that will yield a white box. Make your unhandled error routine fancy, put a breakpoint there and you will not execute that code.

    Example 2: In the same RadGridView, a table can show some information. If something is wrong with one of the hundreds of things in the templated table, when you press the "+" to expand a row in the top-level table; it will turn into a "-". That's all; no error, no breakpoint hit, nothing.

    I am not talking about being able to handle exceptions. There are lots of ways to handle exceptions and tools to analyze them. Thanks for trying, anyway.
  12. Michael
    Michael avatar
    3 posts
    Member since:
    Feb 2008

    Posted 20 Apr 2010 Link to this post

    Sorry you're experiencing so much pain...

    You might consider downloading the source code for the Silverlight controls if you have a subscription, referencing the debug compiled assembly and setting Visual Studio to break on all exceptions.

    This is a shot in the dark... Have you tried running Visual Studio as the administrator?  Perhaps there is something weird with the permissions on your box.


Back to Top
DevCraft banner