create c# program without visual studio


we can find c# compiler in the framework folder and set it's path in environment variables and start writing c# programs. just type a c# program in notepad++ and compile and run it from command prompt

step:1 set environment path using command prompt

C:\Windows\Microsoft.NET\Framework64\v4.0.30319

step:2 open command prompt enter below command

setx path "%path%;C:\Windows\Microsoft.NET\Framework64\v4.0.30319"

step:3 reopen command prompt and check below command

csc

step:4 write program and save firstprogramc#.cs extension

using System;

public class Program
{
public static void Main()
{
Console.WriteLine("Hello World");
}
}

step:5 navigate folder save file 

step:6 compile program 

csc firstprogramc#.cs

step:7

firstprogramc#.exe

Post a Comment

0 Comments