Script execution can be controlled/adjusted through the engine runtime settings. These settings can be viewed/edited with a configuration console.
The configuration console is the utility, which allows to do variety of script engine administrative tasks (installation/uninstallation, enabling shell extensions, enabling integration with Visual Studio, changing runtime behaviour, accessing the documentation...).To start the console execute the following command in command prompt:
This tab displays Advanced shell extensions layout. You can find out more about what this Shell Extension is and how it is different to the explorer Simplified Context Menu in the Advanced Shell Extension chapter.
Use Advanced Shell Extensions
Use this check box to enable or disable Advanced Shell Extension.
Configure Shell Extension
This LinkLabel is used to launch the Advanced Shell Extension configuration utility. This utility allows you to enable/disable particular Shell Extension menu item, edit menu command and change the menu items order.Open
You can also select predefined double-click action for script files from the list of predefined actions (e.g. "Run", "Open with..." ).
Visual Studio integration
This LinkLabel is used to launch the Visual Studio Integration configuration utility. This utility allows you to enable/disable or adjust the level of the CS-Script integration with MS Visual Studio IDE(s) installed on your PC.
Simplified Context Menu Tab
In this list of supported simplified explorer Context Menus you can enable/disable particular one depending on you preferences.
Note: On Windows 8 with Visual Studio 2012 right-click menu configuration may conflict with the CS-Script "Simplified Context Menu" and both Context Menu and Open Action may not work correctly in result. In such cases it is still possible to use CS-Script Advanced Shell Extension as long as it configured for the "Use for all file extensions" (see the Advanced Shell Extension chaprter for details).
Shell command that is executed in order to cleanup any temporary files created by the script engine. This command is entirely optional. Basically it is a custom action triggered by the script engine when number of consecutive runs (DoCleanupAfterNumberOfRuns) reached. If this command is set the script engine is not required to do any cleanup thus it does the execution in the current AppDomain. This means that the script can be executed faster (however the fastest execution can be achieved only with /c switch). You can use clearTemp.cs script from the Script Library as a basic cleanup command ("csws.exe clearTemp.cs").
The number of consecutive runs before CleanupShellCommand would be invoked.
Names of the assemblies (short name) to be referenced automatically by the script being executed. The values must be semicolon separated.
NOTE: During the script execution with //css_host directive the all DefaultRefAssemblies are ignored. The reason for this limitation is very practical. The default assemblies are not warranted may be valid in the surrogate host environment (e.g. System.Linq.dll fo the host prosess of v2.0 .NET).
Scripts from the Script Library can be executed or imported by the script engine without specifying the full script path. You also can nominate additional folders which will be used by the script engine in the same way. It is just a custom version of the "Script Libraries". All assemblies from SerachDirs are automatically available for runtime for loading (see Using .NET assemblies for details). Multiple search directories should be separated by semicolon (;) the same way as it is done for the environment variable PATH. Another, more convenient way of managing Search directories is to do this with Search Directories utility. you can launch it by clicking the LinkLabel Manage SearchDirs.
Set this property to the location of the alternative compiler CodeProvider assembly if you want to use non-C# syntax.
Set this property to the location of the Post-Processing assembly if you need to alter/process compiled script juct before the excution.
You can control the type of threading model of the the script being executed by using [STAThread] or [MTAThread] attributes in the script code. If the threading model is not specified in the code it is set to the DefaultApartmentState value of the runtime settings.
This value contains default command line switches. For example if /c ("cached" mode) switch is specified as a default argument, all scripts will be executed with this switch even if the switch is omitted from the command-prompt command.
By using this setting you can completely (or partially) remove auto-generated files from the script directory. This option (if used) allows you to maintain very clean script directories with script files only. All temporary files (imported scripts, dynamically generated wrappers, script cache) in this case are stored in the specially dedicated temp folder. The possible values for this setting are:
DoNotHide - Do not hide any auto-generated files.
HideMostFiles - Hide the most of the auto-generated files (cache and "imported" files).
HideAll - Hide all auto-generated files including the files generated by pre/post scripts.
If this value is set to True all compiler warnings are not displayed. This may simplify navigation in the compiler output.
If this value is set to True the compiled script is loaded for the execution not from the assembly file but rather from it's in-memory copy. This allows avoiding locking the script assembly file during the execution. This may be usefully in some circumstances, for example if you want to delete the compiled script before it's execution is completed. Be careful when using this setting as your script assembly at runtime will have Location property set to empty string (Assembly.GetExecutingAssembly().Location). Also this value should be set to False for execution of C++ scripts of WWF scripts as CLR expects the assembly to be present in form of file for this type of applications.
If this value is set to True all errors, which the script engine displays to the user, will be reported with the exception stack messages. Otherwise, only the top level exception message is reported.
Specifies the .NET Framework version that the script is compiled against. This option can have the following values:
v2.0 - .NET Framework 2.0
v3.0 - .NET Framework 3.0
v3.5 - .NET Framework 3.5
v4.0 - .NET Framework 4.0
The default setting is .NET Framework 4.0.
This option is similar to the "Target Framework" option in the General Application Settings of C# Visual Studio 2008/2010 projects.
Note: selecting specific version of CLR as Compiler CLR version does not make your script to be executed under the selected CLR but only compiled. If you want your script to be fully hosted under a specific CLR you need to use the hosating control directive (//css_host) in your script.
The settings are stored in the css_config.xml file in the CS-Script home directory.
Press Update button to check if any update for CS-Script is available.
Updating process is automated, what eliminates necessity for manual downloading and configuration. Always review the settings in the "Runtime options" tab as in result of the "settings migration" they may contain invalid values (etc. absolute paths).
Click corresponding link to access specific documentation resources or send feedback emails.