views:

730

answers:

5

WPF 3.5 has PresentationTraceSources for diagnostics and WPFPerf for performance and data binding diagnostics.

Are there equivalent tools / libraries for Silverlight?

+1  A: 

I don't think it's as robust as WPF but here is some things you can do.

Paully
Interesting. It looks like XPerf is quite good for performance troubleshooting. Is there anything available for troubleshooting data binding?
Richard Szalay
For data binding, I usually monitor my Immediate window for data binding errors. Is there something specific you are looking for in databinding troubelshooting?
Paully
The two examples I can think of would be a OneWay binding being removed because the property was directly assigned, and the situation outlined by this article (WPF): http://blog.wouldbetheologian.com/2009/07/why-wpf-databinding-is-awful-technology.html
Richard Szalay
+2  A: 

Although I've marked Paully's answer as "the answer", I thought I'd summarise what I've found so far.

Performance:

Diagnostics:

  • Silverlight Spy can view live XAML DOM
  • Data Binding tracing cannot be configured since the code does not use trace switches/sources. Binding errors are written directly to Trace.Write and the WPF SourceUpdated/TargetUpdated events are not available in Silverlight.
Richard Szalay
+1  A: 

Right, so while I'm certain that possessing a myriad of perf diagnostics tools is fun, what exactly are you trying to accomplish?
Looking at WPF diagnostics tools you've mentioned I could only think "pffff, so what? These are useless 99.999% of the time". Most of that data is fairly useless when it comes down to actually debugging a real world app. Those tools are mostly relevant when debugging the WPF framework itself IMO.

It's definitely true that there's a shortage of good diagnostics tools for some issue in Silverlight.
For instance, there are 0 Silverlight commercial memory profilers out there. But beyond that, I'm unsure as to why you need more than those. So, which tools exactly do you need?

Now that I'm done being smug and uplifting (all at the same time), I'll call out 2 tools you've missed:
1. Silverlight SOS (Son-Of-Strike) extension: Works just like the desktop SOS extension but with a few more extra commands and you'll have to load a silverlight specific sos.dll. This tool is excellent for in-depth memory profiling, learn more about it here and here.
2. The Silverlight3 Analytics class. Using this class you can get the CPU% for your process, the whole CPU usage and the specific model and make for the GPU card.
3. Glimpse for Silverlight - A DataBinding debugging "tool"/control by Karl Shifflett.

Sincerely,
-- Justin

JustinAngel
If you'd read the question and my comments on previous answers, you'd see that the main outstanding area in my queries is troublshooting databinding issues. On the other hand, thanks for pointing out the Analytics class and the SOS Silverlight commands.
Richard Szalay
Gotcha, added a 3rd bullet point on a tool used to debug DataBinding failures.
JustinAngel
Glimpse looks great. Any chance we'll be seeing more of these kind of tools included in the Silverlight SDK in the future?
Richard Szalay
A: 

Our company released a Silverlight code profiler today (EQATEC Profiler 3.1). You can now easily get insights about performance measures. As the first and only profiler in the world it supports all .NET platforms (full, compact and Silverlight).

Eigil Rosager Poulsen
A: 

Here is how you can use Silverlight to profile managed code using ETW.

http://stackoverflow.com/questions/55943/how-to-profile-a-silverlight-application/2480070#2480070

Naveen