{"id":225797,"date":"2019-06-25T08:00:12","date_gmt":"2019-06-25T15:00:12","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/visualstudio\/?p=225797"},"modified":"2021-02-26T13:49:08","modified_gmt":"2021-02-26T21:49:08","slug":"visual-studio-tips-and-tricks","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/visualstudio\/visual-studio-tips-and-tricks\/","title":{"rendered":"Visual Studio tips and tricks"},"content":{"rendered":"<p>Whether you are new or have been using Visual Studio for years, there are a bunch of tips and tricks that can make you more productive. We\u2019ve been sharing tips on Twitter using the <a href=\"https:\/\/twitter.com\/search?q=%23vstip\">#vstip hashtag<\/a> for a while, and this is a collection of the best ones so far.<\/p>\n<h2>Debugger<\/h2>\n<p><strong>Hitting F10<\/strong> to build, run, and attach debugger instead of F5 will automatically break on the first time your own code is being executed. No breakpoints needed.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-225802\" style=\"box-sizing: inherit; color: #52595e; font-family: Arimo,Helvetica Neue,Arial,sans-serif; font-size: 48px; font-style: normal; font-variant: normal; font-weight: 400; height: auto; letter-spacing: normal; max-width: 100%; orphans: 2; outline-color: #72777c; outline-style: solid; outline-width: 1px; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; vertical-align: middle; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; border-style: none;\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/debugger-F10.gif\" alt=\"\" width=\"672\" height=\"276\" \/><b><\/b><i><\/i><u><\/u><\/p>\n<p>Supported from Visual Studio 2005<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Reattach to process<\/strong> (Shift+Alt+P) is extremely helpful when you have to attach to the same process again and again.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-225803\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/debug-reattach.png\" alt=\"\" width=\"400\" height=\"268\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/debug-reattach.png 400w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/debug-reattach-300x201.png 300w\" sizes=\"(max-width: 400px) 100vw, 400px\" \/><\/p>\n<p>Supported from Visual Studio 2017 v15.8<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<p><strong>A blue dot in the margin<\/strong> indicates a switch of threads while stepping through debugging.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-225801\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/debug-blue-dot.jpg\" alt=\"\" width=\"686\" height=\"259\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/debug-blue-dot.jpg 686w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/debug-blue-dot-300x113.jpg 300w\" sizes=\"(max-width: 686px) 100vw, 686px\" \/><\/p>\n<p>Supported from Visual Studio 2013<\/p>\n<h2>Solution<\/h2>\n<p>Improve performance of solution load and reduce visual noise by <strong>disabling restore of node expansions<\/strong> in Solution Explorer as well as <strong>Reopen documents on solution load<\/strong>.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-225810\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/perf-restore-hierarchy.jpg\" alt=\"\" width=\"1053\" height=\"710\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/perf-restore-hierarchy.jpg 1053w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/perf-restore-hierarchy-300x202.jpg 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/perf-restore-hierarchy-768x518.jpg 768w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/perf-restore-hierarchy-1024x690.jpg 1024w\" sizes=\"(max-width: 1053px) 100vw, 1053px\" \/><\/p>\n<p>Supported from Visual Studio 2019<\/p>\n<p>&nbsp;<\/p>\n<p>For fast keyboard navigation, use <strong>Ctrl+T to find anything in your solution<\/strong> &#8211; files, classes etc.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-225808\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/go-to-all.jpg\" alt=\"\" width=\"675\" height=\"265\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/go-to-all.jpg 675w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/go-to-all-300x118.jpg 300w\" sizes=\"(max-width: 675px) 100vw, 675px\" \/><\/p>\n<p>Supported from Visual Studio 2017<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Assign a keyboard shortcut to perform a &#8220;git pull&#8221;<\/strong> so you don&#8217;t have to use CLI or Team Explorer to ensure your repo is up to date.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-225807\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/git-pull.png\" alt=\"\" width=\"1053\" height=\"710\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/git-pull.png 1053w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/git-pull-300x202.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/git-pull-768x518.png 768w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/git-pull-1024x690.png 1024w\" sizes=\"(max-width: 1053px) 100vw, 1053px\" \/><\/p>\n<p>Supported in Visual Studio 2019<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Make Solution Explorer automatically select the current active document<\/strong>, so you never lose track of its location in the project.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-225814\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/track-active-item.jpg\" alt=\"\" width=\"1053\" height=\"710\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/track-active-item.jpg 1053w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/track-active-item-300x202.jpg 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/track-active-item-768x518.jpg 768w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/track-active-item-1024x690.jpg 1024w\" sizes=\"(max-width: 1053px) 100vw, 1053px\" \/><\/p>\n<p>Supported from Visual Studio 2010<\/p>\n<h2>Editor<\/h2>\n<p>Easily <strong>surround HTML<\/strong> elements with a &lt;div&gt; using Shift+Alt+W. The inserted &lt;div&gt; is selected so you can easily edit it to be any tag you&#8217;d like, and the end-tag matches up automatically.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-225805\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/editor-surround-with.jpg\" alt=\"\" width=\"577\" height=\"487\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/editor-surround-with.jpg 577w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/editor-surround-with-300x253.jpg 300w\" sizes=\"(max-width: 577px) 100vw, 577px\" \/><\/p>\n<p>Supported from Visual Studio 2017<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Copy any JSON fragment<\/strong> to the clipboard and paste it as strongly typed .NET classes into any C# or VB code file.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-225823 size-full\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/editor-paste-json-1.jpg\" alt=\"\" width=\"764\" height=\"561\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/editor-paste-json-1.jpg 764w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/editor-paste-json-1-300x220.jpg 300w\" sizes=\"(max-width: 764px) 100vw, 764px\" \/><\/p>\n<p>Supported from Visual Studio 2013<\/p>\n<p>&nbsp;<\/p>\n<p><strong>You don&#8217;t need to write quotation marks<\/strong> around JSON property names, simply type a colon and Visual Studio will insert the quotes automatically.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-225799\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/auto-quotes.gif\" alt=\"\" width=\"248\" height=\"132\" \/><\/p>\n<p>Supported in Visual Studio 2015<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<p><strong>Make IntelliSense and tooltips semi-transparent<\/strong> for the duration you press and hold the Control key.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-225815\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/transparent-presenters.jpg\" alt=\"\" width=\"827\" height=\"700\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/transparent-presenters.jpg 827w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/transparent-presenters-300x254.jpg 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/transparent-presenters-768x650.jpg 768w\" sizes=\"(max-width: 827px) 100vw, 827px\" \/><\/p>\n<p>Supported from Visual Studio 2010<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Instead of retyping &#8216;(&#8216;<\/strong> to show parameter info in method signatures, use Ctrl+Shift+Space to display the currently used overload.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-225818 size-full\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/show-signature-help-1.jpg\" alt=\"\" width=\"853\" height=\"161\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/show-signature-help-1.jpg 853w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/show-signature-help-1-300x57.jpg 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/show-signature-help-1-768x145.jpg 768w\" sizes=\"(max-width: 853px) 100vw, 853px\" \/><\/p>\n<p>Supported from Visual Studio 2010<\/p>\n<p>&nbsp;<\/p>\n<h2>Miscellaneous<\/h2>\n<p><strong>Play a sound<\/strong> when certain events occur within Visual Studio.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-225809\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/misc-sounds.jpg\" alt=\"\" width=\"595\" height=\"712\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/misc-sounds.jpg 595w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/misc-sounds-251x300.jpg 251w\" sizes=\"(max-width: 595px) 100vw, 595px\" \/><\/p>\n<p>Supported from Visual Studio 2010<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<p><strong>Create custom window layouts<\/strong> for specific development scenarios or monitor setups and switch between them easily.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-225821 size-full\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/custom-window-layouts-2.jpg\" alt=\"\" width=\"759\" height=\"535\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/custom-window-layouts-2.jpg 759w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/custom-window-layouts-2-300x211.jpg 300w\" sizes=\"(max-width: 759px) 100vw, 759px\" \/><\/p>\n<p>Supported from Visual Studio 2017<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Specify which Visual Studio components<\/strong> are required for any solution, and Visual Studio will prompt the user to install them if missing. Read more in the blog post <a href=\"https:\/\/devblogs.microsoft.com\/setup\/configure-visual-studio-across-your-organization-with-vsconfig\/\">Configure Visual Studio across your organization with .vsconfig<\/a>.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-225812\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/solution-vsconfig.png\" alt=\"\" width=\"351\" height=\"345\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/solution-vsconfig.png 351w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/solution-vsconfig-300x295.png 300w\" sizes=\"(max-width: 351px) 100vw, 351px\" \/><\/p>\n<p>Supported from Visual Studio 2019<\/p>\n<h2>Extensions<\/h2>\n<p><a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=EWoodruff.VisualStudioSpellCheckerVS2017andLater\">Visual Studio Spell Checker<\/a>. An editor extension that checks the spelling of comments, strings, and plain text as you type or interactively with a tool window. It can also spell check an entire solution, project, or selected items. Options are available to define multiple languages to spell check against.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-225813\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/spell-checker.png\" alt=\"\" width=\"435\" height=\"164\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/spell-checker.png 435w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/spell-checker-300x113.png 300w\" sizes=\"(max-width: 435px) 100vw, 435px\" \/><\/p>\n<p>Supported from Visual Studio 2013<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=MadsKristensen.AddNewFile\">Add New File<\/a>. A Visual Studio extension for easily adding new files to any project. Simply hit Shift+F2 to create an empty file in the selected folder or in the same folder as the selected file.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-225798\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/add-new-file.png\" alt=\"\" width=\"446\" height=\"146\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/add-new-file.png 446w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/add-new-file-300x98.png 300w\" sizes=\"(max-width: 446px) 100vw, 446px\" \/><\/p>\n<p>Supported from Visual Studio 2015<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=LaurentKempe.GitDiffMargin\">Git Diff Margin<\/a>. Git Diff Margin displays live Git changes of the currently edited file on Visual Studio margin and scroll bar.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-225806\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/git-diff-margin.png\" alt=\"\" width=\"400\" height=\"400\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/git-diff-margin.png 400w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/git-diff-margin-150x150.png 150w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2019\/06\/git-diff-margin-300x300.png 300w\" sizes=\"(max-width: 400px) 100vw, 400px\" \/><\/p>\n<p>Supported from Visual Studio 2012<\/p>\n<p>This was just a few of the thousands of available extensions. To see more extensions, go to the <a href=\"https:\/\/marketplace.visualstudio.com\/search?target=VS&amp;category=All%20categories&amp;vsVersion=vs2019&amp;sortBy=Downloads\" rel=\"noopener noreferrer\">Visual Studio Marketplace<\/a>.<\/p>\n<h2>In closing<\/h2>\n<p>These were just a few hand-picked tips from the <a href=\"https:\/\/twitter.com\/search?q=%23vstip\">#vstip hashtag<\/a> on Twitter. There are plenty more to check out. If you have some great tips, please share them using the #vstip hashtag so we can all easily find them.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Whether you are new or have been using Visual Studio for years, there are a bunch of tips and tricks that can make you more productive. We\u2019ve been sharing tips on Twitter using the #vstip hashtag for a while, and this is a collection of the best ones so far.<\/p>\n","protected":false},"author":642,"featured_media":225810,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1388,155],"tags":[294,12],"class_list":["post-225797","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-extensibility","category-visual-studio","tag-extensions","tag-visual-studio"],"acf":[],"blog_post_summary":"<p>Whether you are new or have been using Visual Studio for years, there are a bunch of tips and tricks that can make you more productive. We\u2019ve been sharing tips on Twitter using the #vstip hashtag for a while, and this is a collection of the best ones so far.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/225797","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/users\/642"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/comments?post=225797"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/225797\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media\/225810"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media?parent=225797"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/categories?post=225797"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/tags?post=225797"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}