Visual Studio Tips & Tricks Listing
Thanks to Eric, Jared and Kirill for joining me today for the Live & On Demand Webcast. I'd like to provide a listing of the shortcuts and tips we talked about for your own reference.
Code Editor
- Code Snippets for ‘prop’, ‘foreach’, ‘if’, ‘class’, ‘interface’, Tab-Tab completion
- Surround with (snippets) - try, if
- FormatDocument
- C# Profile - Ctrl+K,D
- Ctrl+Left/Right arrows in code editor – jump between words faster
- Comment/uncomment selection
- C# Profile - Ctrl+K,C – Ctrl+K,U
- Dynamic Snippets in the XML Editor
Navigation
- Go To Definition
- C# Profile - F12
- Metadata as source
- Code Definition Window
- Go To Definition Stack
- C# Profile – Ctrl+Shift+F7, Ctrl+Shift+F8
- Find All References
- C# Profile - Shift+F12, then hit F8 to step through the results in the Find Symbol results window
- Click the “back” button on the Microsoft Explorer mouse with your thumb navigates back (under C# profile)
- Document Tab
- Copy Full Path
- Open Containing Folder
- Iterating List Windows (Error List, Find Results, etc)
- F8 next Item
- Open Document List
- C# Profile – Ctrl + Alt + Down
- TODO Task List Items
- Now Solution Wide in 2008 SP1
- Intellisense/Quick Info Transparency
- Ctrl
Refactoring
- Refactor -> Rename
- Position the caret on an identifier and hit F2 (C# Profile)
- Extract Method
- Context Menu
Code generation
- Generate Method Stub (Smart Tag)
- Ctrl+. and enter (C# Profile)
- Remove and Sort Usings
- Context Menu
Debugging
- First Change Exceptions
- Debug -> Exceptions (allows breaking on a first-chance exception)
- Break Point Context Menu
- Right-click on a breakpoint brings up a context-menu which not everyone knows about ;-)
- Source File and PDB Differences
- Files don’t need to match
- Just My Code
- Tools -> Options -> Debugging -> Enable just my code
- Managed and Native Debugging
- Attach to process -> Cross Platform Debugging (Managed, Native)
- Project properties
- Remote Debugging
- .load sos, !clrstack, !dumpheap, !gcroot, etc.
Solution Explorer
- Tracking Active Item in Solutions Explorer
- Tools -> Options -> Projects and Solutions -> Track Active Item in Solution Explorer
- Open Explorer Window
- Right-click on an item in Solution Explorer – Open Folder in Windows Explorer
- Editing XML of a Project File
- Right-click on a project -> Unload -> edit .csproj file in XML
Comments
- Anonymous
December 17, 2008
The comment has been removed - Anonymous
December 17, 2008
The comment has been removed - Anonymous
December 19, 2008
Mike Benkovich from http://benkotips.com and my fellow C# QA team member Eric Maino have talked me into