Visual Studio is an integrated development environment (IDE). The "integrated" part of IDE means that Visual Studio contains features that complement every aspect of software development:
You can use C# in Visual Studio by selecting the .NET Core workload during installation. If you've already installed Visual Studio, you can add the .NET Core workload by opening the Visual Studio Installer program on your computer and modifying your installation.
When you open Visual Studio, there are a number of tool windows that let you interact with your code:
You can add additional tool windows by using the View menu at the top. For example, the Bookmarks tool window lets you bookmark lines of code for quick access. The layout of your tool windows is highly customizable â€” you can add additional windows, remove the ones you have open, and move them around to best suit how you work.
At the top of the screen, you'll see Visual Studio's menus, which you'll use to run various commands. Here's a high level overview of the most important ones:
The Visual Studio toolbar, shown below the menus, provides quick access to the most common commands.
You can change what commands the toolbar contains by going to View â†’ Customize
When you start writing code in Visual Studio, you begin with a project. A project contains all of the information and files required to create and run a program.
Visual Studio organizes projects into solutions. A solution is a collection of projects that are associated with each other. If you're just getting started, a solution will probably only contain one project.
The easiest way to start coding in Visual Studio is by creating a new project from a template - we'll cover working with existing code in just a moment. Visual Studio will generate a preconfigured project with recommended tools and settings. You can create a new project by going to File â†’ New â†’ Project.
Use the selectors on the left to choose different types of languages or platforms to work with. For example, to create a basic C# project, such as for a "Hello World" application, select the templateConsole App (.NET Core) under the Visual C# selector. Name your project and specify its location, then click OK to create your project.
Besides creating a new project, you can also work with existing code in Visual Studio using one of the following options:
If you have a code repository using Git, you can use the Team Explorer tool window to clone your repository and begin working on it. Go to File â†’ Open â†’ Open from Source Control, and make sure you're in the Manage Connections screen of the Team Explorer by clicking the green Manage Connectionsbutton at the top of the tool window. Click Clone under Local Git Repositories, then enter the URL of your git repo to clone your repository.
If you have an existing Visual Studio project, you can open it by going to File â†’ Open â†’ Project/Solution.
For simple C++, C#, or Visual Basic programs that don't have Visual Studio project and solution files, you can automatically generate Visual Studio projects for your code by using the project creation wizard at File â†’ Open â†’ Project From Existing Code.
If you just want to edit code for an existing project without using Visual Studio's project and build systems, you can open a folder through File â†’ Open â†’ Folder. Though you won't have the full support of Visual Studio's project system, you'll be able to use syntax highlighting, navigate through your code, and debug for C++, C#, Visual Basic, Node.js, and Python projects. You can learn more about opening a folder on the Visual Studio blog and how to use it for C++ on the Visual C++ blog .
To run your code, click the green play button in the toolbar.
This runs your code with the debugger attached - this lets you pause your code at breakpoints, emit debugging messages, and use additional tools in Visual Studio while you're running your code.