Difference between revisions of "Debug in Visual Studio"

From Logic Wiki
Jump to: navigation, search
m
 
 
(One intermediate revision by one other user not shown)
Line 41: Line 41:
 
== Call Stack ==  
 
== Call Stack ==  
 
To see only my calls there is an option under Options and Settings "Enable Just My code"
 
To see only my calls there is an option under Options and Settings "Enable Just My code"
 +
 +
== Stop debugger from code ==
 +
Debugger.Break();

Latest revision as of 10:07, 30 April 2019


Starting to Debug

Debugging a Running Process

  • Without a solution loaded you can still debug
  • Attach to an existing process
  • Useful when solution isn't readily available
  • Accessible from the debug menu
  • Source code debugging still available when attaching a process
  1. Start an app from command line
  2. Open VS and navigate Debug/Attach to process
  3. Find the app you started in process
  4. Open related source code file by using File/Open

Debugging a Solution

F5 / Debug menu etc...

Debug Windows

While debugging Debug/Windows/ menu shows which windows are available

Symbols

Auxiliary metadata about your code (Like line numbers)

To use them : Debug/Options and Settings/Symbols

Callstack and Modules window can also load symbols

Debugging .NET Framework

To debug framework itself

Debug / Options and Settings / General

check two .NET checkboxes and

in Symbols add symbol file location as http://referencesource.microsoft.com/symbols

Click "Load All Symbols"

Call Stack

To see only my calls there is an option under Options and Settings "Enable Just My code"

Stop debugger from code

Debugger.Break();