Create First Visual C# Console Application Visual Studio

Introduction

In this tutorial, you will learn to create a new project in Visual Studio Community. You can create first Visual C# console application by following the steps given below.

First C# Console Application

To create First Visual C# Console Application Visual Studio, you must follow the given steps.

    1. Open Visual Studio.
Start Page Visual Studio
Start Page Visual Studio

Create a New Project in Visual Studio

    1. Go to
      File -> New -> Project
Create New Visual Studio Project
Create New Visual Studio Project

Create a New Console Application in Visual Studio

    1. A Dialog Box will appear, Select Visual C# from the Installed menu.
    2. Choose Console Application from Options pane.
    3. You can also rename the console application which will be created as desired. Also the location on the disk for the new project.
    4. Click Ok to create a new project.
Create a new Visual C# application in Visual Studio
Create a new Visual C# application in Visual Studio

New Console Application Created

    1. An IDE environment will open displaying the main method, including the workspace components of the project.
main method visual C#
main method Visual C#

 

Test the Newly Created Console Application

In order to test the newly created C# project you can

    1. Console.WriteLine(); is used to display a string on Console in C#
    2. Console.ReadKey(); will hold the console until any keyboard key is pressed.


    1. Display Something on Console, using Console.Writeline();
    2.  Read any character from Console, using Console.ReadKey();
    3. Click Start from the top bar, with a green play button to Build and Run your first application
Build and Run Visual C# code
Build and Run Visual C# code

Output

    1. A console window will display the string you put in Console.WriteLine();.
Console Output Visual C#
Console Output Visual C#

 

See Also:
How to Create a New ASP.NET Web Application in Visual Studio 

 

Hope you like this tutorial. Stay tuned for more upcoming tutorials! Stay Blessed!

Leave a Reply

Your email address will not be published. Required fields are marked *