Silverlight Debugging - PowerPoint PPT Presentation

1 / 33
About This Presentation
Title:

Silverlight Debugging

Description:

Clog for Silverlight. Setting up VS2008. Use a Web Application Project ... SL2 Tracing: CLog. Fiddler. What is it? HTTP proxy server. What can you do with it? ... – PowerPoint PPT presentation

Number of Views:64
Avg rating:3.0/5.0
Slides: 34
Provided by: alan83
Category:

less

Transcript and Presenter's Notes

Title: Silverlight Debugging


1
Silverlight Debugging
  • Alan Cobb
  • Independent .NET Consultant
  • Alan Cobb Associates, Inc.
  • Sacramento, CA
  • Silicon Valley Code Camp 2008
  • Saturday, November 8, 2008, 345pm

2
About Alan Cobb
  • Independent consultant for over 20 years on
    Microsoft platforms
  • Silverlight, WPF, .NET, C, C
  • One of directors of the SacDotNet User Group
  • http//www.alancobb.com
  • http//www.alancobb.com/blog

3
Another Code Camp Session
  • WCF Debugging Where Do I Start
  • Presented by Petar Vucetin
  • 915AM Sunday Room 4204
  • See also Web Service debugging section of
    Silverlight documentation
  • Debugging Services for Silverlight Applications

4
Presentation Overview
  • Beginning
  • Setting up VS2008 for SL debugging
  • Alternatives for SL tracing
  • Intermediate
  • SL debugging tools Fiddler, Silverlight Spy
  • Advanced
  • Performance debugging
  • SOS extension Low level .NET debugging

5
Description on Website
  • This session will survey a range of Silverlight 2
    debugging tools and techniques. At the beginner
    level well review setting up VS2008 for
    debugging Silverlight C and JavaScript code.
    Then well look at different techniques for trace
    logging. At an intermediate level well cover
    three debugging tools I use extensively Fiddler,
    Silverlight Spy and NetLimiter. At the advanced
    level well do some low-level Silverlight .NET
    debugging with WinDbg and the SOS debugger
    extension DLL. SOS helps you hunt for memory
    leaks by giving you a detailed view of the
    managed heap. Stack traces from SOS can sometimes
    reveal more about the context of bugs than VS2008
    can.

6
Beginning Level Issues
  • Setting up VS 2008 for SL debugging
  • Know where the settings are
  • Turn on 1st chance exception handling
  • Alternatives for Tracing in SL
  • Debug.WriteLine and DebugView
  • Clog for Silverlight

7
Setting up VS2008
  • Use a Web Application Project
  • Turn on 1st chance exception handling
  • Where are the settings?
  • VS itself, Your project, Web.config, Internet
    Explorer
  • Types of breakpoints
  • JS, .NET client and server side

8
Turn on break when exception thrown
9
Turn on break when exception thrown
10
Which code? Running Where?
Client
Server
11
Main Silverlight DLLs
12
SL Tracing Debug.WriteLine
13
SL Tracing DebugView
14
SL Tracing DebugView
15
SL2 Tracing CLog
16
Fiddler
  • What is it?
  • HTTP proxy server
  • What can you do with it?
  • Watching browser talk to Silverlight sites
  • Debugging cross domain policy file issues
  • Timing analysis (slow connection tests)

17
Fiddler Watch HTTP conversation
18
Reflector
19
Getting generic.xaml with Reflector
20
Fiddler Demo Little Loader App
21
Fiddler Slow Connection Testing
22
Fiddler Download Timing Analysis
23
Silverlight Spy
  • How is Silverlight Spy constructed?
  • Features
  • Browse Silverlight element tree
  • Fly over element tree
  • See element statistics
  • Copy XAML for a given branch
  • Modify element properties interactively
  • Other

24
Demo Silverlight Spy
25
Debugging Performance Issues
  • Seema Ramchandanis PDC2008 talk
  • FrameRate
  • Host.Settings.MaxFrameRate
  • Host.Settings.EnableFrameRateCounter
  • CompositionTarget.Rendering event
  • Host.Settings.EnableRedrawRegions
  • Profiling
  • Xperf ? (A free profiler from MS)

26
Performance The Render Loop
27
Performance Instrumentation Demo
28
SOS Low-level .NET Debugging
  • What is SOS?
  • Extension DLL for WinDbg debugger
  • Downloading WinDbg setting up SOS
  • Intro articles on Silverlight and SOS 1, 2
  • Pointing at Microsoft symbol server
  • What can you use it for?
  • Examine Silverlights managed heap
  • Get more detailed stack traces

29
SOS Where is SOS.DLL?
30
SOS Demo Exception and Hang
31
SOS Demo Detailed Stack Traces
32
SOS Demo Finding Memory Leak
33
SOS Demo Finding Memory Leak
Write a Comment
User Comments (0)
About PowerShow.com