GST Billing Software

header image

Visual Studio Environment

Erachana Line

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.

User Interface

When you open Visual Studio, there are a number of tool windows that let you interact with your code:

Visual Studio tool windows

  1. The Code editor is where you write your code.
  2. The Solution explorer shows the files you're working with.
  3. The Properties pane gives additional information and context about selected parts of your project.
  4. The Output window displays debugging and error messages, compiler warnings, status messages, and other output.

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.

Menus

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: Visual Studio tool windows

  1. The File menu contains commands to create, open, and save projects.
  2. The Edit menu contains commands to search, modify, and refactor your code.
  3. The View menu is where you go to open additional tool windows in Visual Studio.
  4. The Project menu lets you add files and dependencies in your project.
  5. The Debug menu contains commands to run your code and use debugger features.
  6. The Tools menu contains commands to change your settings, add functionality to Visual Studio via extensions, and access various Visual Studio tools.

Toolbar

The Visual Studio toolbar, shown below the menus, provides quick access to the most common commands.

Visual Studio tool windows

You can change what commands the toolbar contains by going to View → Customize

Creating and running a program

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.

Creating a new 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.

Visual Studio tool windows

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.

Working with existing code

Besides creating a new project, you can also work with existing code in Visual Studio using one of the following options:

Opening from an existing source control repository

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.

Opening an existing project

If you have an existing Visual Studio project, you can open it by going to File → Open → Project/Solution.

Creating a Visual Studio project from existing code

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.

Opening a folder

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 .

Running your code

To run your code, click the green play button in the toolbar.

Visual Studio tool windows

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.