Visual Studio 2019 tips and tricks

Visual Studio is an Integrated Development Environment (IDE) developed by Microsoft which is used to code,debug and run the respective applications. According to Wikipedia, Visual Studio supports around 36 programming languages and the advantage of using Visual Studio is that the code editor and debugger will support all these programming languages and also it supports cross-platform.

The latest version of Visual Studio is 2019(16.4.3). There are some major improvements done in Visual Studio 2019 when compared to Visual Studio 2017. The performance and the look & feel has been vastly improved.

In this blog, we are going to explore about some interesting tips and tricks that can be used in Visual Studio.

Tips and tricks to be more Productive

#1 Project Templates

While creating a new project in Visual Studio, it has some predefined templates to get started off with your project. And if you use Visual Studio often, the mostly used templates will be saved and the next time it will be showed up on the Recent Project Templates section.

You can filter the project templates based upon the languages, platforms and also by the project types.

#2 Loading Projects

To improve the load time of your solution, navigate to Tools -> Options -> Projects and Solution. And then uncheck the Restore Solution Explorer project hierarchy state on solution load check box.

By doing this, when you load the solution next time it will restore and resume the existing state of your solution. And also it will improve the load time of your project/solution.

#3 Quick Launch

Quick launch is one of the most powerful feature in Visual Studio. It allows you to traverse to the features of Visual Studio. If you are unable to find any features in it, you can easily search using this quick launch.

It will be present on the topbar or you can also use Ctrl + Q. It uses Fuzzy Search technique to search the items. In the below image you can see I have misspell the word Code(Cdoe) but it gives me proper suggestions.

It can also be used to any file, class, type, member, or symbol declaration.

#4 Code snippets

Visual Studio has some predefined code snippets. It’s very simple to use, just type the respective keyword and press Tab. To know about the keywords, press Ctrl + Q and search for Code Snippets Manager. It has some good number of keywords and also you can add your own custom keywords to generate a code snippet.

Most of the used Code Snippets are ctor for Constructor, prop for creating an property etc.

#5 Document Health Indicator

At the bottom right corner of Visual Studio 2019, we have an Document Health Indicator.

If there are any refactoring needs to be done in the file, there will be an exclamation mark on the bottom right corner of your respective editor, right click on that such that you can traverse between the issues.

#6 Code Cleanup

If the document health indicator shows you warning sign, you can cleanup the respective file or the whole solution using Code Cleanup. So to remove unused variables, unused using statements, sorting the using statements you can use this code cleanup.

You can use Ctrl + E, C to run Code Cleanup. And also the code cleanup is configurable.

Image result for visual studio code cleanup configuration

#7 Extensions

Visual Studio supports extendable tools. On the topbar, you would be able to see a option called Extensions. There are lot of extensions available for Visual Studio which will be very useful to increase your productivity.

If you click on that Extension, you would be able to search for the extensions available and install the respective extension you want.

Live Share and IntelliCode are the two cool extensions which have been introduced in 2019. Other that that, it has almost 1000+extensions in Visual Studio.

You can find some interesting visual studio extensions in this link.

#8 IntelliCode

It provides AIassisted capabilities to provide you proper suggestions when you code. Basically you can train this extension based upon your coding style and you’ll get proper suggestions based on it.

Python AI-enhanced IntelliSense

You can train this model and you can share this model to your colleagues where they will also get proper suggestions when they code.

#9 Vertical selection

You can select multiple lines vertically, by placing the cursor at the first line and then press ALT key and you select the lines downward. It would be very useful in some of the scenarios.

#10 Search Improvements

Overall Visual Studio has some good searching techniques. It allows you to search for the file, text and also it allows you search based upon the projects, solution, file etc.

  • If you want to search on the respective file, press Ctrl + F. The text can be search based upon the casing and also it can be searched on the current block, current document, all open documents, current project and also Entire Solution.
  • You can also use Ctrl + Shift + F to search and replace. There are lot of options available for searching.

#11 Solution Filter

In the large enterprise application, we would have around 20-30 projects and sometimes you don’t need to load all the projects. So in Visual Studio 2019, you can unload those projects and right click on your solution and there will be an new option available called Save as Solution filter.

Image result for visual studio solution filter

Specify a proper name and you can save this as an solution. So the next time if you click that respective solution filter, it wont load the unloaded projects.

#12 Reusable Code

Let’s take a scenario where you want to reuse a code snippet. It can be easily done by selecting the respective code snippet and it can be saved in the Toolbox. To open Toolbox in Visual Studio, press Ctrl + Alt + X and select the snippet and just drag and drop your code.

#13 Navigation

Navigation or Go to which is available in the Edit Menu will be very useful to traverse between your projects. You can navigate to files, recent files, type, member and symbol. You can also traverse through the issues in the respective file.

You can set shortcuts for this action. It would be very helpful when you work on a large enterprise project.

#14 Customize Visual Studio

Visual Studio Environment can be totally customized. You can change your environment themes such as Dark, Light, Blue and Blue(Extra Contrast). And also you can set your colors for variables, methods, classes and interfaces.

Once you log into Visual Studio these environment changes will be synced and whenever you login with that respective account, this environment changes will be applied.

Conclusion

These are some of the tips and tricks that can be used to increase your productivity using Visual Studio 2019. But its a big tool, where there are lot of options available. I have explained only some of the key points to improve the productivity.

Keep Exploring!

Happy Coding!

Cheers!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: