Tuesday, November 12, 2013

compile .cs(C#) file using command

Step-1: Create HelloWorld.cs file on E: drive
using System;
using System.Collections.Generic;
using System.Text;

namespace HelloWorld
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World");
            Console.ReadLine();
           
        }
    }
}


Step-2: Run> cmd (Should have admin privilege)

C:\Windows\Microsoft.NET\Framework\v2.0.50727>csc /out:E:/HelloWorld.exe E:\HelloWorld.cs

Step-3: Check E: drive it creates HelloWorld.exe










No comments:

Post a Comment