🖥️ Debug Like a Pro
Need to test a method while debugging? Immediate Window executes code on the fly. Test expressions, call methods, inspect variables.
đź”§ Using Immediate Window
Debug → Windows → Immediate (Ctrl + Alt + I) While debugging (breakpoint hit): - ? variableName → Show variable value - ? myMethod() → Call method and show result - variableName = "New Value" → Change variable value - ? 5 + 3 → Evaluate expression - ? new List() { 1, 2, 3 }.Count → Test code Examples: ? user.Name // Shows user's name ? user.Age + 10 // Evaluate expression ? GetUserCount() // Call method and show result user.Name = "Alice" // Change value during debug ? $"Hello {user.Name}" // String interpolation
âś… Pro Tips
- Use ? to print value (alias for Print)
- Call static methods without instance
- Test code snippets before writing them
- Modify variables to test different scenarios
“Immediate Window is my secret weapon. Test code without recompiling. Change variables on the fly. Essential for advanced debugging.”
