CSharpScript is a CLR based scripting system which uses the C# programming language.
CSharpScript or CS-Script is a CLR (Common Language Runtime) based scripting system (Script execution engine) which uses ECMA-compliant C# as a programming language. CSharpScript currently targets Microsoft implementation of CLR (.NET 2.0/3.0/3.5/4.0/4.5) with full support on Mono.
Hello.cs
using System;
using System.Windows.Forms;
class Script {
static void Main() {
MessageBox.Show("Hello World!");
}
}
Hosting script engine
dynamic script = CSScript.Evaluator
.LoadMethod(@"void SayHello(string greeting) {
Console.WriteLine(greeting);
}");
script.SayHello("Hello World!");
Benefits of C# Scripting System:
- Simple deployment approach
- Portability
- Base language is a full featured C# and also supports VB.NET, C++/CLI and J#
- Easy conversion of any script into application and vice versa
- Script language is type safe
- Extensibility
- Script hosting
- brings you Dynamic Code Generation
Useful links: