This project is read-only.

Project Description
CSharpCompiler is a free and open-source library to compile c# source code programmatically. With extra features like error and warning handling. This library is so easy to use that you can create an IDE in minutes.


Example:

 

CSharpCompiler compiler = new CSharpCompiler (); 
compiler.SourceCode = richTextBox1.Text;
compiler.Output = CSharpCompiler.OutputType.EXE; 
compiler.Path = "C:\\Users\\Danny\\Desktop"; 
compiler.NameOfAssembly = "Hello World!"; 
compiler.CompileCode();
if (compiler.SuccessfullCompilation == false ) 
{
 
if (compiler.CompilerErrors != null ) 
listBox1.Items.AddRange(compiler.CompilerErrors);
 
if (compiler.CompilerWarnings != null ) 
listBox1.Items.AddRange(compiler.CompilerWarnings);

}

 

Key Features and Reasons Why

- Complies single and multiple source files.

- Stores compiler errors and warnings in an array of string. So it is easy to use.

- Totally light weight ( 4kb) and not dependent on any third-party libraries or API. Only pure .Net framework!

  

 

Source Code:

 

Can be downloaded in the Source Code tab. Ready to use and pre-compiled binary can be downloaded in the Downloads tab. Enjoy!!!

 

 Usage

 

  Output

 

If you are using this in your project, please let me know so I can put your project name on this very page. Hope you enjoy this.

Last edited Apr 29, 2011 at 7:28 PM by cpphacker69, version 9