Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Debugging with Visual Studio
Search
GBPhilip
January 08, 2019
Programming
26
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Debugging with Visual Studio
The debugging features of Visual Studio 2017
GBPhilip
January 08, 2019
Transcript
58 slides
DEBUGGING By Philip Sutton
WHO AM I • Started full time work 1991 •
Worked for Science, Travel, Management Consultancy, Finance, Medical, Education • Programmed in COBOL, Fortran, Visual Basic 6, VB.net and C# as well as Sql • C# since 2005 • Twitter @GBPhilipSutton
INTRODUCTION • Visual Studio Options • Debugging Attributes • Datatips
• Debugging Windows • Dumps • Symbol Servers • Front End • Enterprise Features
VISUAL STUDIO OPTIONS • Debugging Options • Exception Options
DEBUGGING OPTIONS
EXCEPTION OPTIONS
EXCEPTIONS SETTINGS • Demo
DEBUGGING ATTRIBUTES • Debugger Display • Debugger Browsable • Debugger
Type Proxy
DEBUGGERDISPLAY
DEBUGGERDISPLAY • [DebuggerDisplay("Name = {Name}")] • public class Person •
{ • public string Name { get; set; } • public int Age { get; set; } • }
DEBUGGERDISPLAY
DEBUGGERBROWSABLE • public class PersonBrowse • { • public string
Name { get; set; } • public int Age { get; set; } • [DebuggerBrowsable(DebuggerBrowsableState.Collapsed)] • public Address Address { get; set; } • }
DEBUGGERBROWSABLE
DEBUGGERBROWSABLE • Never
DEBUGGERDISPLAY • RootHidden
DEBUGGER PROXY TYPE • Allows the significant and fundament change
on the debugging view of a type. • Demo
DEBUGGER VISUALISERS • Some built in – xml, json, text,
html • Many in the market place • Write your own
DATATIPS
DEBUGGING WINDOWS - LOCALS/AUTO
DEBUGGING WINDOWS - CALL STACK
DEBUGGING WINDOWS - WATCH WINDOW
MULTI-THREADED APPLICATIONS • Thread Window • Debug Toolbar • Debug
Location • Parallel Stacks • Parallel Watch
MULTITHREADED DEBUGGING WINDOWS - THREADS
MULTITHREADING WINDOWS – DEBUG TOOLBAR
MULTITHREADING WINDOWS DEBUG LOCATION
MULTITHREADING WINDOWS PARALLEL STACKS • private static void ParallelExample() •
{ • var names = new List<string> {"Bob", "Judy", "Chris", "Ashley"}; • Parallel.ForEach(names, (name) => • { • for (var i = 0; i < 10; i++) • { • Console.WriteLine($"Hello {name} {i}"); • } • }); • }
MULTITHREADING WINDOWS PARALLEL STACKS
MULTITHREADING WINDOWS PARALLEL WATCH
BREAKPOINTS • Data Breakpoints • Condition • Hit Count •
Filter • When hit • Break at Function
BREAKPOINTS DATA
BREAKPOINTS CONDITIONAL BREAKPOINTS
BREAKPOINTS CONDITIONAL
BREAKPOINTS CONDITIONAL • private static void ConditionalBreakpoints() • { •
for (var i = 0; i < 10; i++) • { • if (i==5) • { • Debugger.Break(); • } • Console.WriteLine($"The value is {i}"); • } • }
BREAKPOINTS CONDITIONAL • private static void ConditionalBreakpoints() • { •
for (var i = 0; i < 10; i++) • { • if ((Debugger.IsAttached) && (i==5)) • { • Debugger.Break(); • } • Console.WriteLine($"The value is {i}"); • } • }
BREAKPOINTS HIT COUNT
BREAKPOINTS HIT COUNT
BREAKPOINTS FILTER
BREAKPOINTS FILTER
BREAKPOINTS WHEN HIT
BREAKPOINTS WHEN HIT
BREAKPOINTS BREAK AT FUNCTION
ADDRESS LEVEL DEBUGGING • Memory • Disassembly • Registers
WPF/UWP • Live Visual Tree • Live Property Explorer
WPF/UWP VISUAL TREE/ PROPERTY EXPLORER
DUMPS
DUMPS
SYMBOL SERVERS • The symbol server enables the debuggers to
automatically retrieve the correct symbol files without product names, releases, or build numbers.
FRONT END • Javascript • Browser Link • Sync •
Inspector
ENTERPRISE • Code Maps • Intellitrace
ENTERPRISE CODE MAPS
ENTERPRISE INTELLITRACE
ENTERPRISE INTELLITRACE
ENTERPRISE INTELLITRACE
ENTERPRISE INTELLITRACE
ENTERPRISE INTELLITRACE
OTHER DEBUGGING ITEMS • Remote Debugging • Azure Debugging •
Live Sharing • WinDbg • SOS
REFERENCES • https://docs.microsoft.com/en-us/visualstudio/debugger - general debugging • https://docs.microsoft.com/en-us/visualstudio/debugger/general- debugging-options-dialog-box?view=vs-2017 debugging
options • https://www.wintellect.com/pdb-files-what-every-developer-must-know/ pdb files • https://blogs.msdn.microsoft.com/jaredpar/2011/03/18/debuggerdisplay- attribute-best-practices/ (old) debugger display best practices • https://blogs.msdn.microsoft.com/visualstudio/2017/06/26/7-lesser-known- hacks-for-debugging-in-visual-studio/
QUESTIONS
Other Decks in Programming
See All in Programming
AIが実装を担う時代の「技術設計」と「チームマネジメント」
kamina_zzz
2
260
はじめてのPLATEAU
nokonoko1203
1
650
Distance field of Julia set
kinakomoti321
0
320
ローカルLLMの基本と近況 2611 / Local LLM basics and recent situation 2611
kishida
2
380
Seven New Principles of Software Engineering
yegor256
0
490
Будущее локальных LLM – Алексей Голобурдин, PythoNN
sobolevn
0
120
Spec-Driven Development - Why Vaadin Is the Perfect Fit
simas
PRO
0
250
Apple Intelligenceとオンデバイス時代の到来
yahir0
0
240
Vapor Mode でアクセシビリティは 壊れないか検証した話
fuqda
1
350
AI-Powered Domain-Driven Design
ziobrando
0
450
GraphQL の onError と Nullability のこれから
quramy
0
220
Rails初心者がパスキーを実装してみて大変だったこと
ktombow
0
190
Featured
See All Featured
The SEO identity crisis: Don't let AI make you average
varn
0
630
Thoughts on Productivity
jonyablonski
76
5.5k
Fireside Chat
paigeccino
43
4.1k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
4
1.2k
What does AI have to do with Human Rights?
axbom
PRO
1
2.5k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
GitHub's CSS Performance
jonrohan
1033
470k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
400
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
2
520
Practical Orchestrator
shlominoach
192
12k