Development Environments

Integrated Development Environments

Using Visual Studio

  

Logo VisualStudio

Visual Studio was an IDE created in 1997. It was initially created to develop C++ and Visual Basic applications under Windows, but it has evolved and now it includes some other languages, such as C#, ASP.NET… In general, you can develop any kind of application supported by the .NET platform, but there are also some other languages that are also supported, such as Java or Python, among others

There are different distributions for Visual Studio: Community, Professional or Enterprise. The first one is free, and you can download it here. It is available for Windows and MacOSX systems. Once you run the installer, you need to choose your workload. For instance, if you are planning to develop desktop or console applications with C# and Windows Forms, you can just choose .NET desktop development.

Visual Studio workloads

1. Creating projects

If we want to create a new project, we go to File > New project menu. Then, we usually choose a C# console application:

Visual Studio new project

In the bottom form, we must specify the project name and location (we can just leave the default location). Then, a new project will be shown, with a default, initial source file called Program.cs, with some default code already written in it:

Visual Studio new project

In order to run the program, we just click on the Start button at the toolbar, or press F5, or Ctrl + F5 if you want the program to stop after finishing, before closing the terminal.

2. Keybindings

In the following tables you can see some of the most common Visual Studio shortcuts or keybindings (under Windows).

Shortcut Action
Ctrl+Shift+N Create a new project.
Ctrl+N Create a new file.
Ctrl+S Save current file.
Ctrl+Shift+S Save every open file.
Ctrl+C/V/X Copy, paste and cut text.
Ctrl+Z Undo last action.
Ctrl+Y Redo last undone action.
Ctrl+F Show search dialog.
Ctrl+H Show replace dialog.
Shortcut Action
Ctrl+L Remove line.
Ctrl+R Rename selected element.
F5/Ctrl+F5 Run application with/without debugging.
Ctrl+Shift+B Rebuild the project.
F11/F10 Step into function / next step (in debug mode).
Shift+F11 Exit function (in debug mode).

Regarding MacOSX, you must replace Ctrl key with Cmd key.

3. Other features

There are other settings that can be set up from Tools > Options menu. For instance, we can show/hide the line numbers from the Text editor subsection, for each specific language (C#, Basic…), or the indentation vertical lines to easily see the boundaries of an if or for statement…