oleg-shilo / cs-script

C# scripting platform
http://www.cs-script.net
MIT License
1.57k stars 234 forks source link

CSScriptLib: CSScript.GlobalSettings.AddSearchDir() probing dirs are not processed #290

Closed oleg-shilo closed 1 year ago

oleg-shilo commented 2 years ago

I must use IEvaluator.LoadFile() instead of IEvaluator.CompileCode(). IEvaluator.CompileCode() emits CS2001 for a ‘//css_imp DateTimeExtension.cs’ telling me this file cannot be found. Maybe, there’s a problem with the search directories, although the CSScript.GlobalSettings.AddSearchDir() is called for the base directory of all scripts and for the directory of each separate script. Thus, all //css_imp go relative (..\XYZ\ABC.cs and so on) to a path contained in the search dir. Using IEvaluator.LoadFile() works for the simple script where the imported cs-files are located in the same folder.