15 Tips and Tricks to Increase Your Productivity in Visual Studio 2019
Tags: dotnet, csharp, productivity
Published: 2019-11-21 11:33:07

---
title: 15 Tips and Tricks to Increase Your Productivity in Visual Studio 2019
published: true
date: 2019-11-20 11:00:35 UTC
tags: dotnet, csharp, productivity
canonical_url: https://www.syncfusion.com/blogs/post/15-tips-to-increase-your-productivity-in-visual-studio-2019.aspx
cover_image: https://www.syncfusion.com/blogs/wp-content/uploads/2019/11/Tile-min-1.jpg
---
## Introduction

[Visual Studio 2019](https://visualstudio.microsoft.com/vs/) is packed with new features for smartly handling code for different projects. This blog compiles tips and tricks that will make you more productive when using Visual Studio 2019. They are:

- Code Cleanup
- Improve performance
- Search in Watch window
- Track active file inside Solution Explorer
- Cycle Clipboard Ring
- Remove and sort namespaces
- Track miscellaneous files
- Run to Cursor
- Reusable code in Toolbox
- Show the Output window automatically
- Run web application in multiple browsers
- Quick launch
- Use keyboard shortcuts
- Vertical selection
- Collapse all

## Code Cleanup

Visual Studio 2019 provides on-demand formatting for a code file, including code style preferences, through the Code Cleanup feature. To run Code Cleanup, click the broom icon at the bottom of the editor, or press **Ctrl** + **K** and **Ctrl** + **E**.

![Code Cleanup Button.](https://www.syncfusion.com/blogs/wp-content/uploads/2019/11/Code-Cleanup-Button.png)<figcaption>Code Cleanup Button</figcaption>

## Improve performance when loading a project

To improve the performance of a project or solution, navigate to **Tools** > **Options** > **Project and Solutions** , and then clear the **Restore Solution Explorer project hierarchy state on solution load** check box. Doing so will restore and resume the existing state of the solution when opening the VS 2019 IDE, improving the solution’s load performance.

![Improving Project Load Performance.](https://www.syncfusion.com/blogs/wp-content/uploads/2019/11/Improving-Project-Load-Performance.png)<figcaption>Improving Project Load Performance</figcaption>

## Search in Watch window

The **Watch** window provides an advanced way to examine a variable. To watch a variable while debugging, add it to the **Watch** window by right-clicking the variable or the DataTip and selecting **Add Watch**. Now, the variable appears in the **Watch** window.

In Visual Studio 2019, we can see the search feature inside the Watch window. Using this, you can quickly identify properties.

Also, you can find all the possible format specifiers by double-clicking the property row and typing, after the property name. The following screenshot illustrates this.

![Search Feature in the Watch Window.](https://www.syncfusion.com/blogs/wp-content/uploads/2019/11/Search-Feature-in-the-Watch-Window.png)<figcaption>Search Feature in the Watch Window</figcaption>

## Track active file inside Solution Explorer

This option reduces your development time when working with large projects. When you work on a project that has a large number of files, it is difficult to find the current active file in the Solution Explorer—you have to scroll through the entire Solution Explorer to find the active file. To find the current active file in the editor inside the Solution Explorer, just select the **Sync with Active Document** option.

![Sync with Active Document Option.](https://www.syncfusion.com/blogs/wp-content/uploads/2019/11/Sync-with-Active-Document-Option.png)<figcaption>Sync with Active Document Option</figcaption>

### How to track the active file automatically

You can track the active file automatically by enabling the corresponding option.

Navigate to **Tools** > **Options** > **Projects and Solutions** > **General** , and then select the **Track Active Item in Solution Explorer** check box to turn on this feature.

![Track Active Item Option.](https://www.syncfusion.com/blogs/wp-content/uploads/2019/11/Track-Active-Item-Option.png)<figcaption>Track Active Item Option</figcaption>

## Cycle Clipboard Ring

Navigate to **Edit > Cycle Clipboard Ring** or press **Ctrl+Shift+V** to perform the multiple paste action.

When you press **Ctrl** + **C** (copy action) or **Ctrl** + **X** (cut action) in Visual Studio to copy or cut text content or a code block, Visual Studio keeps the last 15 copied or cut contents in its memory. **Cycle Clipboard Ring** allows you to cycle through your clipboard and paste the content you need.

You can just copy or cut content 10 times and then paste any of the copied or cut contents using **Ctrl** + **Shift** + **V**. Keep pressing this key combination to cycle through the paste content until you find what you want to paste.

## Remove and sort namespaces

It is important to maintain coding standards during development. Often, we forget to maintain code standards. We may include unused namespaces, or not arrange namespaces in the proper order, or not put system directives at the top. Visual Studio now has an option to correct these mistakes easily.

In the code editor, right-click to show the context menu where you can find the **Remove and Sort Usings** option. Click this option to remove the unwanted namespaces and sort the namespaces in ascending order.

![Remove and Sort Usings Context Menu Option.](https://www.syncfusion.com/blogs/wp-content/uploads/2019/11/Remove-and-Sort-Usings-Context-Menu-Option.png)<figcaption>Remove and Sort Usings Context Menu Option</figcaption>

But you will face another type of coding standard issue even after using this option: _system directives should be placed first_. Keeping the **System** namespaces first in your code is a best practice. This issue can be overcome by setting an advanced option. Navigate to **Tools** > **Options** > **Text Editor** > **C#** > **Advanced** and select the **Place ‘System’ directives first when sorting usings** check box to turn it on.

![Automatically Keeping System Directives First Option.](https://www.syncfusion.com/blogs/wp-content/uploads/2019/11/Automatically-Keeping-System-Directives-First-Option.png)<figcaption>Automatically Keeping System Directives First Option</figcaption>

## Track miscellaneous files

Sometimes, we need to group external files that are not inside the project folder or source, or that are added to the solution file. These external files can be used as references in the development stage. So, Visual Studio has an option to group these files under the **Miscellaneous** folder. With the option enabled, external files opened through the Visual Studio code editor are grouped under the **Miscellaneous** folder, which is available in the **Solution Explorer**.

By default, this option is disabled. To enable it, navigate to **Tools** > **Options** > **Environment** > **Documents** , and then select the **Show Miscellaneous files in Solution Explorer** check box.

![Enabling the Miscellaneous Folder.](https://www.syncfusion.com/blogs/wp-content/uploads/2019/11/Enabling-the-Miscellaneous-Folder.png)<figcaption>Enabling the Miscellaneous Folder</figcaption>

You can restrict the number of files saved in the folder as well. In the previous screenshot, we set the count as 5, so only five external files will be listed under the Miscellaneous folder.

![External Files in the Miscellaneous Folder.](https://www.syncfusion.com/blogs/wp-content/uploads/2019/11/External-Files-in-the-Miscellaneous-Folder.png)<figcaption>External Files in the Miscellaneous Folder</figcaption>

## Run to Cursor

Run to Cursor can help you debug your code more efficiently by directly stopping the debugger where you point your cursor. Using this, you can avoid step-by-step debugging until you reach the point where you really want to start the debugging. When you select the Run to Cursor option, Visual Studio starts the debugger automatically, and execution is stopped at the selected line.

In the code editor, right-click the line where you want to stop the debugger. Select the **Run to Cursor** option in the context menu.

![Run to Cursor Option.](https://www.syncfusion.com/blogs/wp-content/uploads/2019/11/Run-to-Cursor-Option.png)<figcaption>Run to Cursor Option</figcaption>

You can also use the shortcut key combination **Ctrl** + **F10**.

## Reusable code in Toolbox

Visual Studio provides a great feature that lets you place code snippets inside the Toolbox. Just select a code snippet and drag the selected snippet to the **General** tab.

This feature will be very useful when you need to use a code snippet in multiple files or in multiple places. When working on a project, you’ll often copy code from your current page and paste it in another page or location. You lose time scrolling and finding the files or places where you want to paste common code snippets.

Visual Studio provides space in the Toolbox where you can keep common code. From the Toolbox, you can just drag a code snippet and drop it wherever you want.

To keep your common code in the Toolbox, just open the **Toolbox** and expand the **General** tab. Here, you can drop your selected code blocks by dragging them from the code editor. In the following screenshot, we have selected three lines of code and dragged them to the **General** tab.

![Saving Code in the Toolbox.](https://www.syncfusion.com/blogs/wp-content/uploads/2019/11/Saving-Code-in-the-Toolbox.png)<figcaption>Saving Code in the Toolbox</figcaption>

You can also rename your code blocks for easy reference. In the following screenshot, I have renamed the code block as **TestMethod**. I can just drag **TestMethod** from the Toolbox to any page or any place to use it.

![Renaming a Saved Code Block.](https://www.syncfusion.com/blogs/wp-content/uploads/2019/11/Renaming-a-Saved-Code-Block.png)<figcaption>Renaming a Saved Code Block</figcaption>

## Show the Output window automatically

Visual Studio provides an option to set the Output window to be opened automatically each time you start a build.

Navigate to **Tools** > **Options** > **Project and Solutions** , and then select the **Show Output window when build starts** check box.

![Enabling Automatic Show Output Window Option.](https://www.syncfusion.com/blogs/wp-content/uploads/2019/11/Enabling-Automatic-Show-Output-Window-Option.png)<figcaption>Enabling Automatic Show Output Window Option</figcaption>

## Run web application in multiple browsers

Usually, we run our application in any browser to ensure it functions correctly. But, as web developers, we need to ensure the application runs correctly in all major browsers. Visual Studio provides the option to run an application in multiple browsers simultaneously. To do this, select the **Browse With** option in the browser list drop-down. In the dialog that appears, you can see all the browsers, plus the one set as your default. Here, you can select all the browsers you want to run the application in and click **Set as Default**. If you click the **Browse** button at the bottom of the dialog, your web application will start on all the selected browsers simultaneously.

![Choosing Browsers to Run an Application.](https://www.syncfusion.com/blogs/wp-content/uploads/2019/11/Choosing-Browsers-to-Run-an-Application.png)<figcaption>Choosing Browsers to Run an Application</figcaption>

## Quick launch

You can navigate to any file, class, type, member, or symbol declaration quickly using the **Go To** option in Visual Studio. To open the **Go To** window, press **Ctrl** + **T** or **Ctrl** +**Comma (,)** or navigate to **Edit** > **Go To**. **Go to All** enables you to jump to any file, type, member, or symbol declaration quickly.

![Go to All Search Bar.](https://www.syncfusion.com/blogs/wp-content/uploads/2019/11/Go-to-All-Search-Bar.png)<figcaption>Go to All Search Bar</figcaption>

### Search

You can reduce development time by quickly finding files you need. You can use the Visual Studio Search Files option to reduce the amount of time spent on manual lookups.

To search inside the current file, press **Ctrl** + **F**.

![Search in Current File.](https://www.syncfusion.com/blogs/wp-content/uploads/2019/11/Search-in-Current-File.png)<figcaption>Search in Current File</figcaption>

To search inside the current project, press **Ctrl** + **Shift** + **F**.

![Search in Current Project.](https://www.syncfusion.com/blogs/wp-content/uploads/2019/11/Search-in-Current-Project.png)<figcaption>Search in Current Project</figcaption>

## Use keyboard shortcuts

Visual Studio keyboard shortcuts are the best way to work more efficiently and speed up your development. You can find more useful keyboard shortcuts listed on this [website](https://www.dofactory.com/reference/visual-studio-shortcuts).

The following are some of the most commonly used shortcuts.

![Shortcuts in Visual Studio 2019](https://thepracticaldev.s3.amazonaws.com/i/j20k4yu5587qblwkice6.png)

## Vertical selection

If you need to select multiple lines vertically, place the cursor at the beginning of the first line, press and hold **Alt** , and then select the lines downward.

![Vertical Selection.](https://www.syncfusion.com/blogs/wp-content/uploads/2019/11/Vertical-Selection.png)<figcaption>Vertical Selection</figcaption>

## Collapse all

Press and hold **Ctrl** , and then press **M** and **O** continuously to collapse all your code.

![Collapsing Code.](https://www.syncfusion.com/blogs/wp-content/uploads/2019/11/Collapsing-Code.png)<figcaption>Collapsing Code</figcaption>

Refer to this [blog post](https://www.syncfusion.com/blogs/post/10-visual-studio-tips-for-junior-developer.aspx) for some tips for beginner-level developers using Visual Studio.

# Conclusion

In this blog post, we’ve seen many ways to increase your productivity in Visual Studio 2019. We hope this blog helps you work better with Visual Studio 2019.

Syncfusion provides over 1,000 custom controls to ease the work of the developers on the following platforms:

- [ASP.NET Core](https://www.syncfusion.com/aspnet-core-ui-controls)
- [ASP.NET MVC](https://www.syncfusion.com/aspnet-mvc-ui-controls)
- [Angular](https://www.syncfusion.com/angular-ui-components)
- [Blazor](https://www.syncfusion.com/blazor-components)
- [React](https://www.syncfusion.com/react-ui-components)
- [Vue](https://www.syncfusion.com/vue-ui-components)
- [JavaScript](https://www.syncfusion.com/javascript-ui-controls)
- [Flutter](https://www.syncfusion.com/flutter-widgets)
- [Xamarin](https://www.syncfusion.com/xamarin-ui-controls)
- [WPF](https://www.syncfusion.com/wpf-ui-controls)
- [UWP](https://www.syncfusion.com/uwp-ui-controls)
- [WinForms](https://www.syncfusion.com/winforms-ui-controls)

If you have any questions or require clarifications about our components, please let us know in the comments below. You can also contact us through our [support forum](https://www.syncfusion.com/forums), [Direct-Trac](https://www.syncfusion.com/account/login), or [feedback portal](https://www.syncfusion.com/feedback/). We are happy to assist you!

The post [15 Tips and Tricks to Increase Your Productivity in Visual Studio 2019](https://www.syncfusion.com/blogs/post/15-tips-to-increase-your-productivity-in-visual-studio-2019.aspx) appeared first on [Syncfusion Blogs](https://www.syncfusion.com/blogs).