CS-Script 3.20.0

Adding Search Directories

Instead of having script/assembly probing directories specified in global config file (css_config.xml) you can add them only for a particular script execution. This can be achieved by placing a special directive in the script file. Thus you can specify directly in script code where the CS-Script engine should search for files to be loaded at runtime:

//css_searchdir <path>;

path - absolute or relative path of the directory to be added to the CS-Script search directories.

The shorter alias directive //css_dir can be used in place of the //css_searchdir.


The <path> parameter can contain environment variable mask which would be expanded at runtime.
Remember that you may need to escape some path characters that conflict with the //css_ delimiters. See Delimiters Escaping section.


The following example demonstrates how you can include MyAssemblies and CommonAssemblies directories into script and assembly probing.

//css_dir ..\..\MyAssemblies;
//css_dir C:\CommonAssemblies;
using System;

class Script

    static public void Main( string [] args)