Diagnostic Tips and Tricks for Windows Store Applications using Visual Studio 2012
Diagnostic Tips and Tricks forWindows Store Applications usingVisual Studio 2012Brad Sullivanbrads@microsoft.com
I have optionsfor “NativeOnly” and“Script Only”debugging.What if I wantto do both?
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
Contract Debugging• Configure the app to debug without launch in the project properties• F5 the app• Invoke your application manually through the contract
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
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
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!
Memory terminologySize: How large the object is in memoryRetained Size: The amount of memory that the object is preventing thegarbage collector from reclaiming Includes the size of the object Includes the size of all referenced objects (and any objects they reference) that the current object is the only parent of in the memory graph
Size and retained size Object A (100 KB) Object C (50 KB) Object B (500 KB) Object D (100 KB) Object A 100 KB 600 KB Object B 500 KB 500 KB Object C 50 KB 50 KB Object D 100 KB 100 KB
First Chance Exceptions• 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
First Chance Exceptions• Stop on Originate Error Exceptions for C++• Use the memory window on the third parameter to decode the secret message
Related SessionsBeat the Clock: Background Tasking in Windows 8Speaker: Jeff Prosise7 March 9:00Diagnosing issues in your ASP.NET applications in production with VisualStudio 2012Speaker: Brad Sullivan7 March 10:45
More Info About DiagnosticsALM Team Blog: http://blogs.msdn.com/b/visualstudioalm/