SlideShare ist ein Scribd-Unternehmen logo
1 von 69
Visual Studio.NET:
Tips, Tricks, & Toys

by Kevin Grossnicklaus
Agenda
•
•
•
•
•
•
•
•
•
•
•

Introduction
General Tips
Code Editor Tricks
Searching
Layout and Navigation
Advanced Design-Time Tips
Debugging Tips
VS.NET Plug-Ins
External Development Tools
Additional Resources
Questions?
Introduction
• Kevin Grossnicklaus
– ArchitectNow- www.ArchitectNow.net (2009-Present)
• President

– Washington University - CAIT Program (2003-Present)
• Instructor

– SSE - www.SSEinc.com (1999-2009)
• Chief Architect
• Software Development Practice Leader

• Email: kvgros@architectnow.net
• Twitter: @kvgros
Expectations
•
•
•
•

What are we going to cover?
Why is this something I should be aware of?
Who can use this stuff?
How detailed are we going to get?
GENERAL TIPS
Managing Shortcuts
• Keyboard vs. Mouse
• Verify your current environment settings
– This talk assumes “General Development”

• Manage keyboard shortcuts here:
– Tools->Options->Environment->Keyboard

• All settings (including shortcuts) can be imported
and/or exported from:
– Tools->Import and Export Settings
Keyboard Shortcuts
• Standard Shortcuts:
– Ctl-K
– Ctl-Shift-O

• “Chords” = Two character shortcuts
– Written as:
• Ctl-K,D or Ctl-K, Ctl-D
Shortcut Reference Posters
• Visual Studio 2010 Keybinding Posters
– http://www.microsoft.com/enus/download/details.aspx?id=13189
Top Level Shortcuts
•
•
•
•
•
•

Ctl-Shift-N = New Project
Alt-Shift-N = New Website
Ctl-Shift-O = Open Project
Alt-Shift-O = Open Website
Ctl-Shift-A = Add New Item
Alt-Shift-A = Add Existing Item
CODE EDITOR
Cut/Copy/Paste
• Copy or Cut = Ctl-C or Ctl-X (respectively)
– If no selection, cuts or copies the current line to the
clipboard
– If there is a selection, cuts or copies the selection to
the clipboard
• Tools->Options->Text Editor->All Languages->General
• Uncheck the “Apply Cut or Copy Commands to Blank Lines
When There is No Selection” option

• Current Line
– Ctl-L to cut the current line to the clipboard
(including EoL)
– Ctl-Shift-L to delete the current line
Cut/Copy/Paste (Cont.)
• Paste = Ctl-V
– Pastes the last item cut or copied into the editor at
the current cursor location

• Clipboard “Ring” = Ctl-Shift-V
– Cycles through the previous 20 items cut to the
clipboard and pastes them at the current cursor
location
– Accidentally cut or copy something you didn’t mean
to?
• Cycle through pasting until you get to the item you
overwrote
Misc Selection/Insertion Commands

• Ctl-Enter to insert a blank line above
current line
• Ctl-Shift-Enter to insert a blank line
below current line
• Ctl-W to select current word
• Ctl-Delete to delete next word
• Ctl-Backspace to delete previous word
Drag/Drop Code
• Selections of code can be dragged around a
code file or to different files
– Hold Shift to “Copy”

• Code can be dragged onto the Toolbox dockwindow in the “General” section and then
dragged back onto other editors
– These can be renamed to be more readable
– This is a handy way to reuse sections of code
Weird Editor Shortcuts
•
•
•
•

Ctl-T to transpose a character
Ctl-Shift-T to transpose a word
Alt-Shift-T to transpose a line
Ctl-U to make current selection or character
lowercase
• Ctl-Shift-U to make current selection or
character uppercase
Undo/Redo
• Ctl-Z to Undo
• Ctl-Y to Redo
• Use the dropdowns for more granular control
and information
Scrolling
• Use the scroll bars or mouse wheel
• Press mouse wheel to allow for 4-way
navigation
“Go-Back” Markers and Navigation

•
•
•
•

What is a “Go-Back” marker?
Ctl-Minus to navigate backwards
Ctl-Shift-Minus to navigate forwards
Optionally use the toolbar buttons and
dropdown boxes for more info
Navigation Bar
• What is the navigation bar?
• Ctl-F2 to select the navigation bar
• Tab or Shift-Tab to switch between combo
boxes once selected
• Arrow keys to navigate down and enter to select
• To enable/disable per language:
– Tools->Options->Text Editor->All languages (or specific
language)->General
– Set the “Navigation Bar” option
Splitting Editor Windows
•
•
•
•

Window->Split to split
Window->Remove Split to remove
Splitter can be resized via mouse
F6 to switch between split panes
Line Numbers
• Enable line numbers here:
– Tools->Options->Text Editor->All languages (or
specific language)->General
– Check “Line Numbers”
Track Changes
 Tools->Options->Text Editor->General
 Check “Track Changes”

 What does this do?
 Yellow – Lines were edited since last save.
 Green – Lines were edited prior to last save.
 Yellow becomes Green after one save, close and re-open a
file and Green is gone
Code Selection
• Click and drag to select code via the common
“stream” mode
• Hold Alt-Shift and click and drag to select
in “box” mode
• Shift-Arrow Keys to manually select
code in “stream” mode
• Alt-Shift-Arrow Keys to manually
select in “box” mode
Formatting
• What does code formatting do?
• Where can I adjust the settings?
– Tools->Options->Text Editor->(Language)>Formatting

• Ctl-K,D to format the current document
• Ctl-K,F to format the current selection
Outlining
•
•
•
•

Ctl-M,M to toggle outlining around cursor
Ctl-M,L to toggle all outlining in current file
Ctl-M,P to turn off outlining
Edit->Outlining->Start Automatic Outlining to
turn back on
• Ctl-M,O to collapse to definitions
• Selecting a collapsed definition allows you to
cut and paste it as a whole
Remove Unused Usings
• Right click in editor and select:
– Organize Usings->Remove Unused Usings
Bookmarks
• Ctl-K,K to toggle bookmarks on current
line
• Ctl-K,N to go to the next bookmark
• Ctl-K,P to go to the previous bookmark
• Ctl-K,L to clear all bookmarks
• Ctl-K,W to view the bookmarks window
• Organizing Bookmarks
Commenting
• Handy Shortcuts:
– Ctl-K,C = Comment Block
– Ctl-K,U = Uncomment Block

• XML Comments
• Task List Comments
– //TODO
– //HACK
– //UNDONE
Intellisense
• Ctl-J to invoke statement completion (i.e.
bring up Intellisense)
• Ctl-Space or Alt-Right Arrow for
statement completion
Smart-Tags
• Ctl-Period to drop down a Smart-Tag
menu
– Enter to select the first item

• Resolve Context Menu
Code Snippets
• Ctl-K,X to bring up Code Snippet menu
– Type-ahead supported
– Or enter the snippet shortcut keyword and press
Tab-Tab

• Ctl-K,S to insert a code snippet around a
selected block of code
• Tab and Shift-Tab to switch between
“tokens”
• Ctl-K,B to bring up the Code Snippet
Manager
Refactoring
• Ctl-R,R to rename current item
• Ctl-R,M to extract the currently selected code
into a new method
• Ctl-R,E to encapsulate field into a property
• Ctl-R,I to extract interface from current class
• Ctl-R,P to promote selected local variable to a
parameter
• Ctl-R,V to remove parameters
• Ctl-R,O to reorder parameters
Call Hierarchy Window
• To display: Ctl-K,T
• Nice navigation between calling methods and
methods called from the current method
SEARCHING
Searching - 1
• Incremental Search
– Ctl-I
– Start typing
– Ctl-I again to jump to next occurrence

• Current Word Search
– Ctl-F3 to search for the currently selected word
– Ctl-Shift-F3 to search for the current word looking
backwards

• Quick Find
– Ctl-F to bring up Quick Find with current word as the
default
– Use Regular Expressions
Searching - 2
• Quick Replace
– Ctl-H brings up the Quick Replace window with
the current word as the default

• Find Symbol
– Alt-F12 brings up the Find Symbol dialog
– Shift-Alt-F12 searches for the current word
using the Find Symbol functionality but skips the
UI
Searching - 3
• Find in Files
– Ctl-Shift-F opens the Find in File dialog

• Replace in Files
– Ctl-Shift-H opens the Replace in Files dialog

• Find in Files options
LAYOUT AND NAVIGATION
Document Windows
• Document Windows = Tabbed Documents
• Ctl-Alt-Down Arrow to drop down file tab
channel
• Tab Context Menu
– Close All But This
– Copy Full Path
– Open Containing Folder

• Tab Groups
– Horizontal or Vertical

• Windows Menu
Document Navigation
• Ctl-Tab to display the IDE navigator
– Ctl-Tab again to scroll through open documents
– Ctl-Shift-Tab to scroll in reverse
– Arrow keys or mouse to select a document or dockwindow

• Ctl-F6 and Ctl-Shift-F6 to jump between
currently open documents without using the IDE
navigator (forwards and backwards)
• Ctl-F4 to close the current document
Dock/Tool Windows
• Docking Targets
• Five “States”
–
–
–
–
–

Dockable
Floating
Tabbed
Hide
Auto-Hide

• Alt-F7 and Alt-Shift-F7 to scroll (forwards or
backwards) through all opened tool windows using the IDE
navigator
• Alt-F6 and Alt-Shift-F6 to scroll (forwards or
backwards) through all opened tool windows without the
navigator
Dock/Tool Windows (Cont.)
• Tool windows that are hidden can be shown
via their shortcut key or most are found under
one of the following menu locations:
– View
– View->Other Windows
– Debug->Windows
Window Layouts
• Four Layouts:
– Design View
– Full Screen
– Debugging View
– File View

• Shift-Alt-Enter to toggle between Full
Screen mode and Design View
Toolbars
•
•
•
•

Drag and drop customization
Visible based on current context
Right click to display any toolbar at any time
Customization dialog
– “Show Shortcut Keys in Screen Tips”
– Full customization of all toolbars while this dialog
is visible
Context Menu Customization
• Complete editing of any context menus
• Tools->Customize
• Select Toolbars tab
• Check “Context Menus”
ADVANCED DESIGN TIME TIPS
Quick Launch
• In Title Bar
• Ctl-Q to place cursor
Command Window
• Ctl-Alt-A to open the command window
• Enter a > to run any VS command from the
command prompt
– Full Intellisense for commands, arguments, and
even file paths
– Command aliasing
• ? = Debug.Print
• Enter “alias” by itself to see current aliases
Task Window
• Custom Tasks
• Task Shortcuts
• Comment Tasks
External Tools
• How to add external tools?
– Redirecting console output to Output Window
– Passing arguments
Code Definition Window
• Ctl-,D to show the Code Definition Window
• This window is a read-only source view of any
symbol currently selected in the live editor.
– Code can be copied from this window
– Breakpoints can be set
DEBUGGING
Common Shortcuts
•
•
•
•
•

F5 to start debugging
Ctl-F5 to start without debugging
F11 to step into the current line
F10 to step over the current line
Shift-F5 to stop debugging
Breakpoints
• F9 to toggle a breakpoint
– Or, simply click in the left border of the code
editor

• Ctl-Shift-F9 to delete all breakpoints
• Ctl-B to show Break at Function dialog
Breakpoints - Advanced
• Breakpoint Context Menu
– Location
– Condition
– Hit Count
– Filter
– When Hit
Next Statement Manipulation
• Yellow arrow = “NEXT” statement to execute
• Can be dragged to new location
– Within Limits
– Be careful
Debugging Threads
• Ctl-Alt-H brings up the Threads tool
window
• At breakpoints all threads break together
• Threads can be frozen/thawed from the
Threads tool window
– This keeps them paused when execution
continues

• Threads toolbar also exposes functionality
Break On All Exceptions
• Ctl-Alt-E to bring up Exceptions dialog
• It is common to break when a CLR exception is
“thrown”
– This will break even when the exception is caught
by a try/catch block
Variables Windows
• They Are:
– Locals (Ctl-Alt-V,L)
– Autos (Ctl-Alt-V,A)
– Watch (Ctl-Alt-W,1-4)
– Quick Watch (Ctl-Alt-Q)

• All have similar functionality
– All display values of variables and allow for inplace editing

• Provides access to debugging visualizers
Runtime Variable Tooltips
• Provides ability to view all of an objects
properties and manipulate the values directly
in the tooltip
• Provides access to debugging visualizers
Debugging Visualizers
• Special user interfaces used to view the values of
specific data types in variable windows or
runtime tooltips
• Noted by the magnifying glass icon near the value
– Click to open visualizer

• Notable visualizers:
–
–
–
–

Datasets
Test
XML
HTML
Immediate Window
• Ctl-Alt-I to bring up the Immediate Window
• The immediate window can be used to execute
statements and evaluate expressions in the
context of the current statement
– Access to any variable in scope is granted
– Can assign values to variables, read values, execute
methods, etc

• Use the “>” character to allow entry and use of
any VS commands (as in the Command window)
• Command window has much of the same
functionality
Son of Strike (SoS)
• SoS is a debugger extension that is loaded with
VS.NET and available from within the IDE from
the Immediate Window
• To load SoS:
– Edit your project properties and, under the Debug
tab, check the “Enable Unmanaged Code Debugging”
– Open the Immediate Window and enter:
• .load sos

– For help, enter:
• !help
Debugging The BCL
• Microsoft has made many of the debug
symbols for the Base Class Libraries available
for public use
– What does this mean?
– Does this mean .NET is open source?
Debugging into the BCL
• How can I hook this up?
– Options->Debugging->General
– CHECK “Enable .NET Framework Source Stepping”

• Loading Symbols
– From the Modules window or the Call Stack, right
click on a BCL DLL and select “Load Symbols”
VISUAL STUDIO EXTENSIONS
Extension Manager
• Extensions and Updates
• Common Ones I Use:
– Microsoft Web Developer Tools
– NuGet Package Manager
– Productivity Power Tools 2012
– VSCommands for Visual Studio 2012
– Web Essentials 2012
Kevin Grossnicklaus

President
636.236.3279
800.362.3919 x 101

kvgros@architectnow.net
http://architectnow.net or @kvgros
Conclusion

Thank you for coming!

Weitere ähnliche Inhalte

Ähnlich wie St. Louis Days of .NET 2013: Visual Studio Tips and Tricks

Javascript done right - Open Web Camp III
Javascript done right - Open Web Camp IIIJavascript done right - Open Web Camp III
Javascript done right - Open Web Camp IIIDirk Ginader
 
Mastering your Eclipse IDE - Java tooling, Tips & Tricks - EclipseCon Europe ...
Mastering your Eclipse IDE - Java tooling, Tips & Tricks - EclipseCon Europe ...Mastering your Eclipse IDE - Java tooling, Tips & Tricks - EclipseCon Europe ...
Mastering your Eclipse IDE - Java tooling, Tips & Tricks - EclipseCon Europe ...Noopur Gupta
 
Altium productivity
Altium productivityAltium productivity
Altium productivityAlex Borisov
 
Productivity Tips For Altium Designer
Productivity Tips For Altium DesignerProductivity Tips For Altium Designer
Productivity Tips For Altium DesignerSchattke
 
Sublime Text Round-up
Sublime Text Round-upSublime Text Round-up
Sublime Text Round-upPagepro
 
Visual Studio 2010 - Microsoft Visual C# Key Bindings
Visual Studio 2010 - Microsoft Visual C# Key BindingsVisual Studio 2010 - Microsoft Visual C# Key Bindings
Visual Studio 2010 - Microsoft Visual C# Key BindingsGlobalLogic Ukraine
 
C# 101: Intro to Programming with C#
C# 101: Intro to Programming with C#C# 101: Intro to Programming with C#
C# 101: Intro to Programming with C#Hawkman Academy
 
Getting the Most from Xamarin Studio - Michael Hutchinson
Getting the Most from Xamarin Studio - Michael HutchinsonGetting the Most from Xamarin Studio - Michael Hutchinson
Getting the Most from Xamarin Studio - Michael HutchinsonXamarin
 
Continuous improvements of developer efficiency with modern IDE
Continuous improvements of developer efficiency with modern IDEContinuous improvements of developer efficiency with modern IDE
Continuous improvements of developer efficiency with modern IDEMikalai Alimenkou
 
C game programming - SDL
C game programming - SDLC game programming - SDL
C game programming - SDLWingston
 
2013 april gruff webinar san diego copy
2013 april  gruff webinar   san diego copy2013 april  gruff webinar   san diego copy
2013 april gruff webinar san diego copySemantic Web San Diego
 
2013 april gruff webinar san diego copy
2013 april  gruff webinar   san diego copy2013 april  gruff webinar   san diego copy
2013 april gruff webinar san diego copyBarbaraStarr2009
 
2013 april gruff webinar san diego copy
2013 april  gruff webinar   san diego copy2013 april  gruff webinar   san diego copy
2013 april gruff webinar san diego copyBarbaraStarr2009
 
CPP02 - The Structure of a Program
CPP02 - The Structure of a ProgramCPP02 - The Structure of a Program
CPP02 - The Structure of a ProgramMichael Heron
 
Ease your dev life with Sublime Text 2
Ease your dev life with Sublime Text 2Ease your dev life with Sublime Text 2
Ease your dev life with Sublime Text 2Nickolay Ninarski
 
Unleashing the Java Tooling in Eclipse IDE - Tips & Tricks!
Unleashing the Java Tooling in Eclipse IDE - Tips & Tricks!Unleashing the Java Tooling in Eclipse IDE - Tips & Tricks!
Unleashing the Java Tooling in Eclipse IDE - Tips & Tricks!Noopur Gupta
 
Programming Language
Programming  LanguageProgramming  Language
Programming LanguageAdeel Hamid
 

Ähnlich wie St. Louis Days of .NET 2013: Visual Studio Tips and Tricks (20)

Javascript done right - Open Web Camp III
Javascript done right - Open Web Camp IIIJavascript done right - Open Web Camp III
Javascript done right - Open Web Camp III
 
Mastering your Eclipse IDE - Java tooling, Tips & Tricks - EclipseCon Europe ...
Mastering your Eclipse IDE - Java tooling, Tips & Tricks - EclipseCon Europe ...Mastering your Eclipse IDE - Java tooling, Tips & Tricks - EclipseCon Europe ...
Mastering your Eclipse IDE - Java tooling, Tips & Tricks - EclipseCon Europe ...
 
Altium productivity
Altium productivityAltium productivity
Altium productivity
 
Productivity Tips For Altium Designer
Productivity Tips For Altium DesignerProductivity Tips For Altium Designer
Productivity Tips For Altium Designer
 
PowerPoint Presentation Part 1
PowerPoint Presentation Part 1PowerPoint Presentation Part 1
PowerPoint Presentation Part 1
 
Sublime Text Round-up
Sublime Text Round-upSublime Text Round-up
Sublime Text Round-up
 
Visual Studio 2010 - Microsoft Visual C# Key Bindings
Visual Studio 2010 - Microsoft Visual C# Key BindingsVisual Studio 2010 - Microsoft Visual C# Key Bindings
Visual Studio 2010 - Microsoft Visual C# Key Bindings
 
C# 101: Intro to Programming with C#
C# 101: Intro to Programming with C#C# 101: Intro to Programming with C#
C# 101: Intro to Programming with C#
 
Getting the Most from Xamarin Studio - Michael Hutchinson
Getting the Most from Xamarin Studio - Michael HutchinsonGetting the Most from Xamarin Studio - Michael Hutchinson
Getting the Most from Xamarin Studio - Michael Hutchinson
 
Introduction to c ++ part -1
Introduction to c ++   part -1Introduction to c ++   part -1
Introduction to c ++ part -1
 
Continuous improvements of developer efficiency with modern IDE
Continuous improvements of developer efficiency with modern IDEContinuous improvements of developer efficiency with modern IDE
Continuous improvements of developer efficiency with modern IDE
 
C game programming - SDL
C game programming - SDLC game programming - SDL
C game programming - SDL
 
2013 april gruff webinar san diego copy
2013 april  gruff webinar   san diego copy2013 april  gruff webinar   san diego copy
2013 april gruff webinar san diego copy
 
2013 april gruff webinar san diego copy
2013 april  gruff webinar   san diego copy2013 april  gruff webinar   san diego copy
2013 april gruff webinar san diego copy
 
2013 april gruff webinar san diego copy
2013 april  gruff webinar   san diego copy2013 april  gruff webinar   san diego copy
2013 april gruff webinar san diego copy
 
CPP02 - The Structure of a Program
CPP02 - The Structure of a ProgramCPP02 - The Structure of a Program
CPP02 - The Structure of a Program
 
Ease your dev life with Sublime Text 2
Ease your dev life with Sublime Text 2Ease your dev life with Sublime Text 2
Ease your dev life with Sublime Text 2
 
Introduction to C ++.pptx
Introduction to C ++.pptxIntroduction to C ++.pptx
Introduction to C ++.pptx
 
Unleashing the Java Tooling in Eclipse IDE - Tips & Tricks!
Unleashing the Java Tooling in Eclipse IDE - Tips & Tricks!Unleashing the Java Tooling in Eclipse IDE - Tips & Tricks!
Unleashing the Java Tooling in Eclipse IDE - Tips & Tricks!
 
Programming Language
Programming  LanguageProgramming  Language
Programming Language
 

Kürzlich hochgeladen

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 

Kürzlich hochgeladen (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

St. Louis Days of .NET 2013: Visual Studio Tips and Tricks

  • 1. Visual Studio.NET: Tips, Tricks, & Toys by Kevin Grossnicklaus
  • 2. Agenda • • • • • • • • • • • Introduction General Tips Code Editor Tricks Searching Layout and Navigation Advanced Design-Time Tips Debugging Tips VS.NET Plug-Ins External Development Tools Additional Resources Questions?
  • 3. Introduction • Kevin Grossnicklaus – ArchitectNow- www.ArchitectNow.net (2009-Present) • President – Washington University - CAIT Program (2003-Present) • Instructor – SSE - www.SSEinc.com (1999-2009) • Chief Architect • Software Development Practice Leader • Email: kvgros@architectnow.net • Twitter: @kvgros
  • 4. Expectations • • • • What are we going to cover? Why is this something I should be aware of? Who can use this stuff? How detailed are we going to get?
  • 6. Managing Shortcuts • Keyboard vs. Mouse • Verify your current environment settings – This talk assumes “General Development” • Manage keyboard shortcuts here: – Tools->Options->Environment->Keyboard • All settings (including shortcuts) can be imported and/or exported from: – Tools->Import and Export Settings
  • 7. Keyboard Shortcuts • Standard Shortcuts: – Ctl-K – Ctl-Shift-O • “Chords” = Two character shortcuts – Written as: • Ctl-K,D or Ctl-K, Ctl-D
  • 8. Shortcut Reference Posters • Visual Studio 2010 Keybinding Posters – http://www.microsoft.com/enus/download/details.aspx?id=13189
  • 9. Top Level Shortcuts • • • • • • Ctl-Shift-N = New Project Alt-Shift-N = New Website Ctl-Shift-O = Open Project Alt-Shift-O = Open Website Ctl-Shift-A = Add New Item Alt-Shift-A = Add Existing Item
  • 11. Cut/Copy/Paste • Copy or Cut = Ctl-C or Ctl-X (respectively) – If no selection, cuts or copies the current line to the clipboard – If there is a selection, cuts or copies the selection to the clipboard • Tools->Options->Text Editor->All Languages->General • Uncheck the “Apply Cut or Copy Commands to Blank Lines When There is No Selection” option • Current Line – Ctl-L to cut the current line to the clipboard (including EoL) – Ctl-Shift-L to delete the current line
  • 12. Cut/Copy/Paste (Cont.) • Paste = Ctl-V – Pastes the last item cut or copied into the editor at the current cursor location • Clipboard “Ring” = Ctl-Shift-V – Cycles through the previous 20 items cut to the clipboard and pastes them at the current cursor location – Accidentally cut or copy something you didn’t mean to? • Cycle through pasting until you get to the item you overwrote
  • 13. Misc Selection/Insertion Commands • Ctl-Enter to insert a blank line above current line • Ctl-Shift-Enter to insert a blank line below current line • Ctl-W to select current word • Ctl-Delete to delete next word • Ctl-Backspace to delete previous word
  • 14. Drag/Drop Code • Selections of code can be dragged around a code file or to different files – Hold Shift to “Copy” • Code can be dragged onto the Toolbox dockwindow in the “General” section and then dragged back onto other editors – These can be renamed to be more readable – This is a handy way to reuse sections of code
  • 15. Weird Editor Shortcuts • • • • Ctl-T to transpose a character Ctl-Shift-T to transpose a word Alt-Shift-T to transpose a line Ctl-U to make current selection or character lowercase • Ctl-Shift-U to make current selection or character uppercase
  • 16. Undo/Redo • Ctl-Z to Undo • Ctl-Y to Redo • Use the dropdowns for more granular control and information
  • 17. Scrolling • Use the scroll bars or mouse wheel • Press mouse wheel to allow for 4-way navigation
  • 18. “Go-Back” Markers and Navigation • • • • What is a “Go-Back” marker? Ctl-Minus to navigate backwards Ctl-Shift-Minus to navigate forwards Optionally use the toolbar buttons and dropdown boxes for more info
  • 19. Navigation Bar • What is the navigation bar? • Ctl-F2 to select the navigation bar • Tab or Shift-Tab to switch between combo boxes once selected • Arrow keys to navigate down and enter to select • To enable/disable per language: – Tools->Options->Text Editor->All languages (or specific language)->General – Set the “Navigation Bar” option
  • 20. Splitting Editor Windows • • • • Window->Split to split Window->Remove Split to remove Splitter can be resized via mouse F6 to switch between split panes
  • 21. Line Numbers • Enable line numbers here: – Tools->Options->Text Editor->All languages (or specific language)->General – Check “Line Numbers”
  • 22. Track Changes  Tools->Options->Text Editor->General  Check “Track Changes”  What does this do?  Yellow – Lines were edited since last save.  Green – Lines were edited prior to last save.  Yellow becomes Green after one save, close and re-open a file and Green is gone
  • 23. Code Selection • Click and drag to select code via the common “stream” mode • Hold Alt-Shift and click and drag to select in “box” mode • Shift-Arrow Keys to manually select code in “stream” mode • Alt-Shift-Arrow Keys to manually select in “box” mode
  • 24. Formatting • What does code formatting do? • Where can I adjust the settings? – Tools->Options->Text Editor->(Language)>Formatting • Ctl-K,D to format the current document • Ctl-K,F to format the current selection
  • 25. Outlining • • • • Ctl-M,M to toggle outlining around cursor Ctl-M,L to toggle all outlining in current file Ctl-M,P to turn off outlining Edit->Outlining->Start Automatic Outlining to turn back on • Ctl-M,O to collapse to definitions • Selecting a collapsed definition allows you to cut and paste it as a whole
  • 26. Remove Unused Usings • Right click in editor and select: – Organize Usings->Remove Unused Usings
  • 27. Bookmarks • Ctl-K,K to toggle bookmarks on current line • Ctl-K,N to go to the next bookmark • Ctl-K,P to go to the previous bookmark • Ctl-K,L to clear all bookmarks • Ctl-K,W to view the bookmarks window • Organizing Bookmarks
  • 28. Commenting • Handy Shortcuts: – Ctl-K,C = Comment Block – Ctl-K,U = Uncomment Block • XML Comments • Task List Comments – //TODO – //HACK – //UNDONE
  • 29. Intellisense • Ctl-J to invoke statement completion (i.e. bring up Intellisense) • Ctl-Space or Alt-Right Arrow for statement completion
  • 30. Smart-Tags • Ctl-Period to drop down a Smart-Tag menu – Enter to select the first item • Resolve Context Menu
  • 31. Code Snippets • Ctl-K,X to bring up Code Snippet menu – Type-ahead supported – Or enter the snippet shortcut keyword and press Tab-Tab • Ctl-K,S to insert a code snippet around a selected block of code • Tab and Shift-Tab to switch between “tokens” • Ctl-K,B to bring up the Code Snippet Manager
  • 32. Refactoring • Ctl-R,R to rename current item • Ctl-R,M to extract the currently selected code into a new method • Ctl-R,E to encapsulate field into a property • Ctl-R,I to extract interface from current class • Ctl-R,P to promote selected local variable to a parameter • Ctl-R,V to remove parameters • Ctl-R,O to reorder parameters
  • 33. Call Hierarchy Window • To display: Ctl-K,T • Nice navigation between calling methods and methods called from the current method
  • 35. Searching - 1 • Incremental Search – Ctl-I – Start typing – Ctl-I again to jump to next occurrence • Current Word Search – Ctl-F3 to search for the currently selected word – Ctl-Shift-F3 to search for the current word looking backwards • Quick Find – Ctl-F to bring up Quick Find with current word as the default – Use Regular Expressions
  • 36. Searching - 2 • Quick Replace – Ctl-H brings up the Quick Replace window with the current word as the default • Find Symbol – Alt-F12 brings up the Find Symbol dialog – Shift-Alt-F12 searches for the current word using the Find Symbol functionality but skips the UI
  • 37. Searching - 3 • Find in Files – Ctl-Shift-F opens the Find in File dialog • Replace in Files – Ctl-Shift-H opens the Replace in Files dialog • Find in Files options
  • 39. Document Windows • Document Windows = Tabbed Documents • Ctl-Alt-Down Arrow to drop down file tab channel • Tab Context Menu – Close All But This – Copy Full Path – Open Containing Folder • Tab Groups – Horizontal or Vertical • Windows Menu
  • 40. Document Navigation • Ctl-Tab to display the IDE navigator – Ctl-Tab again to scroll through open documents – Ctl-Shift-Tab to scroll in reverse – Arrow keys or mouse to select a document or dockwindow • Ctl-F6 and Ctl-Shift-F6 to jump between currently open documents without using the IDE navigator (forwards and backwards) • Ctl-F4 to close the current document
  • 41. Dock/Tool Windows • Docking Targets • Five “States” – – – – – Dockable Floating Tabbed Hide Auto-Hide • Alt-F7 and Alt-Shift-F7 to scroll (forwards or backwards) through all opened tool windows using the IDE navigator • Alt-F6 and Alt-Shift-F6 to scroll (forwards or backwards) through all opened tool windows without the navigator
  • 42. Dock/Tool Windows (Cont.) • Tool windows that are hidden can be shown via their shortcut key or most are found under one of the following menu locations: – View – View->Other Windows – Debug->Windows
  • 43. Window Layouts • Four Layouts: – Design View – Full Screen – Debugging View – File View • Shift-Alt-Enter to toggle between Full Screen mode and Design View
  • 44. Toolbars • • • • Drag and drop customization Visible based on current context Right click to display any toolbar at any time Customization dialog – “Show Shortcut Keys in Screen Tips” – Full customization of all toolbars while this dialog is visible
  • 45. Context Menu Customization • Complete editing of any context menus • Tools->Customize • Select Toolbars tab • Check “Context Menus”
  • 47. Quick Launch • In Title Bar • Ctl-Q to place cursor
  • 48. Command Window • Ctl-Alt-A to open the command window • Enter a > to run any VS command from the command prompt – Full Intellisense for commands, arguments, and even file paths – Command aliasing • ? = Debug.Print • Enter “alias” by itself to see current aliases
  • 49. Task Window • Custom Tasks • Task Shortcuts • Comment Tasks
  • 50. External Tools • How to add external tools? – Redirecting console output to Output Window – Passing arguments
  • 51. Code Definition Window • Ctl-,D to show the Code Definition Window • This window is a read-only source view of any symbol currently selected in the live editor. – Code can be copied from this window – Breakpoints can be set
  • 53. Common Shortcuts • • • • • F5 to start debugging Ctl-F5 to start without debugging F11 to step into the current line F10 to step over the current line Shift-F5 to stop debugging
  • 54. Breakpoints • F9 to toggle a breakpoint – Or, simply click in the left border of the code editor • Ctl-Shift-F9 to delete all breakpoints • Ctl-B to show Break at Function dialog
  • 55. Breakpoints - Advanced • Breakpoint Context Menu – Location – Condition – Hit Count – Filter – When Hit
  • 56. Next Statement Manipulation • Yellow arrow = “NEXT” statement to execute • Can be dragged to new location – Within Limits – Be careful
  • 57. Debugging Threads • Ctl-Alt-H brings up the Threads tool window • At breakpoints all threads break together • Threads can be frozen/thawed from the Threads tool window – This keeps them paused when execution continues • Threads toolbar also exposes functionality
  • 58. Break On All Exceptions • Ctl-Alt-E to bring up Exceptions dialog • It is common to break when a CLR exception is “thrown” – This will break even when the exception is caught by a try/catch block
  • 59. Variables Windows • They Are: – Locals (Ctl-Alt-V,L) – Autos (Ctl-Alt-V,A) – Watch (Ctl-Alt-W,1-4) – Quick Watch (Ctl-Alt-Q) • All have similar functionality – All display values of variables and allow for inplace editing • Provides access to debugging visualizers
  • 60. Runtime Variable Tooltips • Provides ability to view all of an objects properties and manipulate the values directly in the tooltip • Provides access to debugging visualizers
  • 61. Debugging Visualizers • Special user interfaces used to view the values of specific data types in variable windows or runtime tooltips • Noted by the magnifying glass icon near the value – Click to open visualizer • Notable visualizers: – – – – Datasets Test XML HTML
  • 62. Immediate Window • Ctl-Alt-I to bring up the Immediate Window • The immediate window can be used to execute statements and evaluate expressions in the context of the current statement – Access to any variable in scope is granted – Can assign values to variables, read values, execute methods, etc • Use the “>” character to allow entry and use of any VS commands (as in the Command window) • Command window has much of the same functionality
  • 63. Son of Strike (SoS) • SoS is a debugger extension that is loaded with VS.NET and available from within the IDE from the Immediate Window • To load SoS: – Edit your project properties and, under the Debug tab, check the “Enable Unmanaged Code Debugging” – Open the Immediate Window and enter: • .load sos – For help, enter: • !help
  • 64. Debugging The BCL • Microsoft has made many of the debug symbols for the Base Class Libraries available for public use – What does this mean? – Does this mean .NET is open source?
  • 65. Debugging into the BCL • How can I hook this up? – Options->Debugging->General – CHECK “Enable .NET Framework Source Stepping” • Loading Symbols – From the Modules window or the Call Stack, right click on a BCL DLL and select “Load Symbols”
  • 67. Extension Manager • Extensions and Updates • Common Ones I Use: – Microsoft Web Developer Tools – NuGet Package Manager – Productivity Power Tools 2012 – VSCommands for Visual Studio 2012 – Web Essentials 2012
  • 68. Kevin Grossnicklaus President 636.236.3279 800.362.3919 x 101 kvgros@architectnow.net http://architectnow.net or @kvgros