Visual Studio features
Last modified on Mon 01 Aug 2022

For developing purposes, most of us are using Visual Studio (VS) as our main IDE. VS is built with many features and capabilities for various programming languages but we will share some useful tips for .NET development.

Project templates

VS comes with a list of predefined templates that you can choose from when starting a new project. It is important to select the right project template as it can generate code or sections of code that allow you to focus on implementing business requirements instead of messing with development infrastructure.

Some of the templates that are most commonly used:

Some of these templates provide additional configuration in the setup itself so the code generated is immediately ready to use. For example, Azure Functions project allows you to chose what type of trigger do you want for your function. It also allows you to setup a connection string to the trigger so the generated code can be run and debug locally.

Visual Studio also allows you to create your own templates for the project. The instructions on how to create your custom template can be found on this link.

Extensions

VS allows you to add extensions that enhance or alter functionalities provided by the IDE. There are a lot of extensions that can be found at 'Extensions' tab or searched on the internet. Some of the extensions are free and some of them are paid.

Some free extensions that we suggest:

App settings configuration

Different projects require different setting configurations, like connection string to database or URL to external API etc. These configurations in .NET are usually stored in appsettings.json file. Visual studio allows you to create different configurations through 'Configuration Manager' found in the 'Build' tab. By default projects are run in 'Debug' configuration with appsettings.json but it can be changed to use different settings, for example appsettings.Test.json.

Additionally VS allows you to use 'user secrets' by right clicking on project and clicking on 'Manage User Secrets'. These secrets are stored on your machine and cannot be pushed to github. These secrets override appsettings.json and are useful for local development.

Connecting to Azure

VS can be connected to Azure account by clicking on 'Manage connections' in 'Team' tab. When VS is connected to Azure it allows you to use several different features, such as accessing DevOps git repository, selecting specific existing trigger (like blob or queue) from your Azure account etc. These Azure connections can also be used to connect to Azure database or other resources and manage them through VS itself.

Shortcuts

VS provides shortcuts to some most common actions. All shortcuts can be found by clicking on 'Options' under 'Tools' tab in the 'Keyboard' menu. Note that some extensions modify or add new shortcuts. Shortcuts can also be exported or imported.

Some of the most common that we use:

A list of helpful tips and tricks can be found on this link.