# Need help with compilation of C# programs



## manoj_mafiosi (Feb 4, 2009)

I'm using notepad++. it's an opensource software. how to compile C# programs. suppose i can't compile it using notepad++ suggest alternatives..!


----------



## RChandan (Feb 5, 2009)

You need the dotNET Framework. If you have that already, locate csc.exe, and add the path to your PATH variable.

Then you can fire up a cmd prompt and compile any file anywhere. Or, you can setup a run command for cs files in Notepad++ or Textpad. In either case, the runnable will be the csc.exe, and that's basically for compiling. The active file parameter is usually a %1, or %s, depending on the tool. Check the documentation to figure it out.


----------



## Pragadheesh (Feb 6, 2009)

Notepad++ is just a text editor that supports syntax highlighting for 44 programming, scripting, and markup languages.Also allowing us to define our own language, using the built-in User Language Define System.

why dont you use MS Visual Studio or some other IDE for writing your C# code than doing it in a text editor. 
also SharpDevelop is a free ide for C# and VB.NET projects on Microsoft's .NET platform.


----------



## gaurarpit (Feb 8, 2009)

There are a few options u can try:

1. either use an IDE ;like Microsoft Visual Studio and in that u can directly compile and execute a C# program by Ctrl+F5. MS Visual Studio installs dotnet framework during its installation (MS Visual Studio 2005 has .NET framwork 2.0 and 2008 version has .NET framework 3.5 with it.)

2. another way is to install only dotnet framework (2.0 or 3.5) whatever u want to. Then, u write the C# program in notepad++ or any text editor. (notepad++ is merely a text editor, more enhanced than notepad).
Locate the directory where dotnet framework has installed csc.exe. Copy ur C# code file in that folder and compile using "*csc abc.cs*" (without quotes). *abc.cs* is ur C# code file with extension .cs. Then run file using "*cs abc*". And u are done, where *cs* is the interpreter.
Another way, if u dont like to copy the file to that folder, then u can set the path of csc.exe in ur environment variables and then u can directly compile n execute from the command prompt.


----------



## dheeraj_kumar (Feb 9, 2009)

Or, if you really want to be open source, go for the Mono Project.


----------



## gaurarpit (Feb 10, 2009)

^^^^^

You are promoting pirated copy of books. O'Reilly doesnt allow free distribution of its publication, and u have given so many links of Head First series...


----------



## dheeraj_kumar (Feb 17, 2009)

^^ huh?


----------



## Jayanth.M.P (Feb 19, 2009)

dude use Microsoft Visual C# Express edition. Its free and its great....


----------

