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?
10 Answers, 1 is accepted
answered on 19 Apr 2010, 03:18 PM
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:
answered on 19 Apr 2010, 03:27 PM
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...
answered on 19 Apr 2010, 04:04 PM
answered on 19 Apr 2010, 04:30 PM
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?
answered on 19 Apr 2010, 05:05 PM
answered on 19 Apr 2010, 05:21 PM
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.
answered on 20 Apr 2010, 08:21 AM
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.
answered on 20 Apr 2010, 06:27 PM
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.
answered on 20 Apr 2010, 06:48 PM
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.
answered on 20 Apr 2010, 10:20 PM
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.