Presentation is loading. Please wait.

Presentation is loading. Please wait.

Msdevcon.ru#msdevcon. ИЗ ПЕРВЫХ РУК: ДИАГНОСТИКА ПРИЛОЖЕНИЙ С ПОМОЩЮ ИНСТРУМЕНТОВ VISUAL STUDIO 2012 MAXIM GOLDIN Senior Developer, Microsoft.

Similar presentations


Presentation on theme: "Msdevcon.ru#msdevcon. ИЗ ПЕРВЫХ РУК: ДИАГНОСТИКА ПРИЛОЖЕНИЙ С ПОМОЩЮ ИНСТРУМЕНТОВ VISUAL STUDIO 2012 MAXIM GOLDIN Senior Developer, Microsoft."— Presentation transcript:

1 msdevcon.ru#msdevcon

2 ИЗ ПЕРВЫХ РУК: ДИАГНОСТИКА ПРИЛОЖЕНИЙ С ПОМОЩЮ ИНСТРУМЕНТОВ VISUAL STUDIO 2012 MAXIM GOLDIN Senior Developer, Microsoft

3 Agenda  Diagnostics in Production  Remote Debugger  IntelliTrace  Dump Debugger  Diagnostics of Client Applications  First Chance Exceptions in C++  Mixed-language  Contracts  Background tasks  Installed apps without VS project

4 Challenges in Production  Can’t reproduce the issue in a development environment  Can’t run Visual Studio on the production machine  Possibly very limited developer access to production machines  Want to minimize impact to the server  Performance  Availability  Security

5 Remote Debugger: The Big Hammer  Advantages  Often the fastest way to resolve an issue  Easy installation  Remote Tools  Xcopy deployable (%ProgramFiles%\Microsoft Visual Studio\Common7\IDE\Remote Debugger)  Configurable Authentication  Disadvantages  Your service becomes unresponsive if you are stopped in the debugger  Requires some firewall configuration

6 Remote Debugger TCP/IP

7 DEMO Remote Debugger

8 Improvements in Visual Studio 2012  Single Firewall Configuration (Remote Debugger Side)  Can connect across different domains  Symbols load from the Visual Studio side  No need to copy symbol files to your production machine  Faster  No need to choose between x86 and x64

9 IntelliTrace  A “Back-in-Time” debugger  Configurable logging to trace the state of an application through its execution history  Integrated with the Visual Studio Debugger UI for analysis  Can be run either locally or via command line

10 IntelliTrace Collection Plans  2 Default Levels  Events  Calls  Custom?  Can turn individual events on/off  Can include/exclude modules  Change max log file size  Requires Editing XML  http://blog.qetza.net/en/2010/03/08/vs-2010-personnalisation-des-vnements-de- lintellitrace/ http://blog.qetza.net/en/2010/03/08/vs-2010-personnalisation-des-vnements-de- lintellitrace/

11 IntelliTrace in Production  Download the IntelliTrace Collector  http://www.microsoft.com/en-us/download/details.aspx?id=30665 http://www.microsoft.com/en-us/download/details.aspx?id=30665  Run it on your production machine  Pick a collection plan  Target the application  Reproduce the issue  Bring the IntelliTrace log back to your development machine  Analyze in Visual Studio to find the bug

12 DEMO IntelliTrace In production

13 Impact on Server Performance  Depends on a number of factors  Number of events collected  Number of modules included in application (startup jitting costs)  Calls data collection  IO

14 Dump Files  Snapshots of the application at a single point in time  Two major types  With Heap – allows full inspection of the state of the app at that point in time  Without Heap – only allows for inspection of the call stacks across all threads  Can be opened directly in VS and debugged just like a regular application  Except no stepping…

15 Creating Dump Files in Production  Several tools available, including Visual Studio  ProcDump has many qualities that make it ideal for production use  Command line  Xcopy deployable  Provides triggers for dump collection  CPU usage, Memory usage, Exceptions (with filters)  Low impact on system performance  Available through Microsoft SysInternals: http://technet.microsoft.com/en- us/sysinternals/dd996900.aspxhttp://technet.microsoft.com/en- us/sysinternals/dd996900.aspx

16 DEMO ProcDump In production

17 Symbols (PDBs)  The debugger and IntelliTrace all need symbols to function properly  Symbols provide a mapping between the binaries you are analyzing and the source code that produced them  Also provide information for determining the local variables for a function  Symbol files must exactly match the build that you are diagnosing  It is easy for your development environment to get out of sync with what is in production

18 Agenda  Diagnostics in Production  Remote Debugger  IntelliTrace  Dump Debugger  Diagnostics of Client Applications  First Chance Exceptions in C++  Mixed-language  Contracts  Background tasks  Installed apps without VS project

19 First Chance Exception Tough to find your real error in XAML apps Turning on first chance exceptions can create a lot of noise that can slow you down Async patterns can make this worse

20 DEMO FIRST CHANCE EXCEPTION

21 First Chance Exception Stop on Originate Error Exceptions for C++ Use the memory window on the third parameter to decode the secret message

22 Native/Managed Debugging for Store Apps  Remote Debugging  Native Visualization  Reliable Stepping  Shipped in Update 1

23 Mixed-language I have options for “Native Only” and “Script Only” debugging. What if I want to do both?

24 DEMO DEBUGGING NATIVE AND JAVASCRIPT

25 Debugging Native and JavaScript  No Mixed Mode Debugging Support  Use Multiple VS Instances Instead  Launch the app under the script debugger  Attach with the native debugger from a second instance of VS  Visual Studio naturally gives focus to the correct instance  Cannot Debug JavaScript when stopped in the native debugger

26 Contract Debugging  Windows 8 contracts provide a new entry point for applications  It’s not the same code as just launching under the debugger  Simply attaching is not quick enough as you may have missed the code that you wanted to debug

27 DEMO CONTRACT DEBUGGING

28 Contract Debugging  Configure the app to debug without launch in the project properties  F5 the app  Invoke your application manually through the contract

29 Background Tasks  Your app can register to run background tasks when certain events happen  Some background tasks are straight forward to test and debug because you can trigger them manually  Others can be a much bigger pain  Like a maintenance trigger that fires after 8 hours

30 DEMO BACKGROUND TASK DEBUGGING

31 Background Tasks  Trigger background tasks from the Debug Location Toolbar  Can trigger tasks on apps that are not running  Set them to debug without launching first  Can trigger tasks that do not require a payload

32 No Projects  There are several reasons why you may not have a VS project, but still want to debug  Permissions  Convenience  Normally build/deploy outside of VS  Attach to process is a pain for WWAs  Especially if you need to debug startup code!

33 DEMO NO PROJECT DEBUGGING

34 No Projects  Use the “Debug Installed App Package Feature”  Works both local and remote  Can automatically stop at the first line of JavaScript Code

35 Agenda  Diagnostics in Production  Remote Debugger  IntelliTrace  Dump Debugger  Diagnostics of Client Applications  First Chance Exceptions in C++  Mixed-language  Contracts  Background tasks  Installed apps without VS project

36 More Info, Request Features Maxim Goldin : mgoldin@microsoft.com ALM Team Blog: http://blogs.msdn.com/b/visualstudioalm http://blogs.msdn.com/b/visualstudioalm Uservoice site: http://visualstudio.uservoice.comhttp://visualstudio.uservoice.com

37 © 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.


Download ppt "Msdevcon.ru#msdevcon. ИЗ ПЕРВЫХ РУК: ДИАГНОСТИКА ПРИЛОЖЕНИЙ С ПОМОЩЮ ИНСТРУМЕНТОВ VISUAL STUDIO 2012 MAXIM GOLDIN Senior Developer, Microsoft."

Similar presentations


Ads by Google