Lesson 1.3

First C# Program in VS SDK


Objective

How to open visual studio code editor for writing c# program?
How to debug and execute program?
How to get output of written program?

Your First C# Program

Welcome to your first lesson. In this chapter we will focus to make first program and see how to compile them and takes output. We always focus on less theory, lot programming module so; there is no bulshit no time wasting.

Make your first program.

We assume that the following module is installed on your PC.

Visual Studio 2005 or 2008 or 2012

Step 1. Open Visual Studio

Open File

Step 2. Go to File > New > Project

Open File

Step 3: Select Console Application in Visual C# and Press OK.

Open File

Congratulations!!! You have successfully opened your first console application. Now we will write a simple code and debug them to see output.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("WooooHoooooo!!! Its my first console application");
            Console.ReadLine();
        }
    }
}

Step 4: Press F5 to run the program

OutputOpen File

Explain

It’s funny to tell you but there is nothing to understand in this program. After passing the next few chapters, you will understand everything. Motive of this chapter is to learn you where to write and how to run the program. If you have run this program successfully you have crossed your half way. Now move to next chapter for getting some more programming examples.

BackNext