This is the general pattern of usage command-line parameters with a CS-Script engine executable (eg. csc.exe):
(switch1)
Command line switch | Description |
---|---|
/? or /help | Display help info. |
/e | Compiles script into console application executable. |
/ew | Compiles script into Windows application executable. |
/c | Use compiled file (.compiled) if found (to improve performance). |
/ca | Pre-compiles script file into assembly (.compiled). |
/cd | Compiles script file into assembly (.dll). |
/s | Prints content of sample script (eg. csc.exe /s > sample.cs). |
/autoclass or /ac | Automatically generates wrapper class if the script does not define any class. |
(switch2)
Command line switch | Description |
---|---|
/nl | No logo mode: No banner will be shown at execution time. |
/dbg or /d | Forces compiler to include debug information. |
/l | 'Local' switch, which forces script to start in the same directory where it is. |
/verbose | Prints runtime information during the script execution (applicable for console clients only) |
/v |
Prints CS-Script version information |
/noconfig[:<file>] | Do not use default config file (css_config.xml) or use alternative one. Example: cscs.exe /noconfig sample.cs; cscs.exe /noconfig:c:\cs-script\css_VB.xml sample.vb |
/sconfig[:<file>] | Use script config file or custom config file as a .NET application configuration file. |
/r | Forces the script engine to load explicitly referenced assembly |
/dir | Adds path(s) to the assembly probing directory list. (eg. cscs.exe /r:C:\MyLibraries myScript.cs). |
/co:<options> | Passes compiler options directy to the language compiler. (eg. /co:/d:TRACE pass /d:TRACE option to C# compiler). |
/precompiler |
Specifies custom precompiler file(s). This can be either script or assembly file (see Precompilers for details). |
Executable aliases
CS-Script engine executable comes in two different forms:
In all command line examples throughout this document "cscs.exe" is referred as "cscs".
CS-Script engine launcher
For convenience you can use special the CS-Script engine launcher css.exe. If it is used from command prompt it acts exactly as cscs.exe. However, if it is executed not from command-prompt (eg. Start->Run), it hides the console application window thus it acts as csws.exe. Please note that if it happens that during the execution the script does some console output (eg. Console.WriteLine(...)), css.exe will detect it and will display the console window if it was hidden.
CS-Script Help
If the script engine executable is launched with help parameter it will be interpreted as a help.cs script file file and the CS-Script Help fill be opened:
CS-Script fundamentals | Integration with OS