Any C# code can be qualified as a script code if it meets the following requirements:
Script must contain a valid (ECMA compliant ) C# code.
C# code must contain a defined method static void Main() as a main entry point for scripting application. This is the same as for any CLR application.
NOTE: presence of static void Main() is optional when CS-Script is used for script hosting.
All assemblies that are referenced within the code should be nominated as such by any of the following techniques:
for automatic resolving at execution time.
for explicit assembly loading from a script code.
/r: command-line switch
for explicit assembly loading from a command-line script string.
The script engine is implemented as both an executable and as a class library assembly (CSScriptLibrary.dll). CSScriptLibrary assembly may be used in any CLR application (see script hosting). It is an interface library of the script engine. The two major classes implemented in the CSScriptLibrary are:
CSScript - class that implements compiling script into assembly
AsmHelper - class which can be used to simplify assembly loading/unloading and assembly method browsing
Click the button below to see details of the CSScriptLibrary class library.
CSScriptLibrary Help (cs-script/Docs/Help/CSScriptLibrary.chm)