Facilitating the spread of knowledge and innovation in professional software development



Choose your language

InfoQ Homepage News CS-Script - The C# Script Engine

CS-Script - The C# Script Engine


Do you wish for a scripting language with access to the .NET Framework and the syntax of C#? With CS-Script, you get just that.

CS-Script supports running individual C# files as if they were script files. The author claims the system has a performance hit of only 40 to 60 seconds over compiled executables. The script engine can target both 1.1. and 2.0 frameworks.

CS-Script supports assembly references in one of two ways. The first option is to implicitly pull in assemblies by searching the Global Assembly Cache (GAC) and local directory for assemblies with names that match the needed namespace. According to the documentation:

The approach is based on the fact that in a real life there is a strong correlation between the assembly name and the root namespace. For example, the namespace System.Windows.Forms is implemented in the assembly System.Windows.Forms, and the namespace System.XML is implemented in the assembly System.XML. This is also applicable to the assembly file name, which is usually a DLL file with the same name as the assembly name.
The second method is to embed the reference as a comment using "//css_reference ;"

CS-Script can also be used as a host to enable script support from within another application.


We need your feedback

How might we improve InfoQ for you

Thank you for being an InfoQ reader.

Each year, we seek feedback from our readers to help us improve InfoQ. Would you mind spending 2 minutes to share your feedback in our short survey? Your feedback will directly help us continually evolve how we support you.

Take the Survey

Rate this Article


Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p


Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.