Visual Studio Features
Last modified on Tue 28 Nov 2023

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 a development infrastructure.

Some of the templates that are most commonly used:

Some of these templates provide an additional configuration in the setup itself so the code generated is immediately ready to use. For example, the Azure Functions project allows you to choose what type of trigger 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 debugged 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 the '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 the 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 the '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 the 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 an Azure account by clicking on 'Manage connections' in the 'Team' tab. When VS is connected to Azure it allows you to use several different features, such as accessing the 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 the 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 the '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.