27

Diagnosing issues in Windows Phone 8.1 XAML Apps with Visual Studio 2013

  • Upload
    shawna

  • View
    45

  • Download
    0

Embed Size (px)

DESCRIPTION

Diagnosing issues in Windows Phone 8.1 XAML Apps with Visual Studio 2013. Dan Taylor Visual Studio Diagnostics Microsoft. 3-578. Motivation. Find and fix issues quickly Build reliable, fast fluid apps. Scope and Terminology. - PowerPoint PPT Presentation

Citation preview

Page 1: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013
Page 2: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013

Dan TaylorVisual Studio DiagnosticsMicrosoft

Diagnosing issues in Windows Phone 8.1 XAML Apps with Visual Studio 2013

3-578

Page 3: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013

MotivationFind and fix issues quickly

Build reliable, fast fluid apps

Page 4: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013

Scope and TerminologyFocusing on Windows Phone 8.1 Store apps using C# and XAML (XAML apps)

Almost all of this content applies to XAML apps on Windows

Some features apply to Silverlight 8.0/8.1, other app types, and platforms

Page 5: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013

Setting the sceneDebugging• First-chance Exceptions• Data Binding• Async Debugging• JSON Visualizer• Lifecycle Events• Contracts

Performance and Diagnostics

Agenda

Page 6: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013

Debugging

Page 7: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013

Debugging swallowed exceptions, async code, JSON, and data binding

Demo

Page 8: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013

Features CoveredFirst-chance exceptions to break where exceptions are thrown

Page 9: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013

Features CoveredAsync debugging shows causality of async code

The Tasks window shows active async operations and awaits

Page 10: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013

Features CoveredThe JSON Visualizer is useful when JSON strings are used in server calls or other places in code (VS 2013 Update 2)

Page 11: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013

Features CoveredData binding errors are shown in the output window (XAML Only)

In addition, you can add a callback and set a breakpoint

Page 12: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013

Features CoveredPinned data tips show variables at a glance

Right-click to set tracepoints and conditional breakpoints

Page 13: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013

Debugging App Lifecycle EventsDemo

Page 14: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013

Features CoveredTurn on the Debug Location toolbar and use Lifecycle Events to trigger suspend, resume, and background tasks (XAML only)

Your app will otherwise not suspend while debugging (usually a good thing)

Page 15: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013

Features CoveredTo debug share contracts, set the start action in project properties to debug when the app is started (XAML only)

For Silverlight: enable tombstoning

Page 16: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013

OverviewDebuggingPerformance and Diagnostics• UI Responsiveness• CPU Usage• Energy Consumption• Memory Usage

Agenda

Page 17: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013

Performance and Diagnostics

Page 18: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013

Common Performance ProblemsOperations take a long time to completeUI is not responsive or “choppy”App drains the battery and users noticeHigh memory usage: app is terminated

Always use a Release build on a physical device

Page 19: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013

Analyzing UI performance, energy consumption, and memory leaks

Demo

Page 20: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013

Features CoveredThe Performance and Diagnostics hub is the starting point for performance investigations (XAML only)

Page 21: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013

Features CoveredCPU Usage + XAML UI Responsiveness to see work on the UI thread and functions using the CPU (XAML only)

Page 22: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013

Features CoveredCPU Usage + Energy Consumption to estimate power consumption and evaluate tradeoffs between CPU, Network, and Display (XAML Only)

Page 23: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013

Features CoveredUse the Memory Usage tool to monitor memory usage and take snapshots of C#/VB/C++ memory (XAML only)

Page 24: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013

Features CoveredOpen snapshots for detailed memory breakdownDiff snapshots to identify causes of memory growth/leaks

Page 25: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013

ResourcesFor in-depth info on everything we covered and more:http://blogs.msdn.com/b/visualstudioalm/archive/tags/diagnostics/

Related talks• 3-579 Diagnosing Issues in Windows Phone JavaScript Apps Using Visual

Studio• 3-580 Internet Explorer 11’s Developer Tools, F12, Just Got Nicer (Again) • 4-557 How to Analyze Performance Issues in Your Windows and Windows

Phone Apps• 3-591 Building Great Windows and Windows Phone XAML Apps with Visual

Studio 2013

Page 26: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013

Your Feedback is ImportantFill out an evaluation of this session and help shape future events. Scan the QR code to evaluate this session on your mobile device. You’ll also be entered into a daily prize drawing!

Page 27: Diagnosing issues  in Windows Phone 8.1  XAML Apps  with Visual Studio 2013

© 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.