Multiple document with ScriptRun


I’m trying to execute a script with ScriptRun with two document loaded from database. When I only have one document, I’m using ScriptRun.ScriptSource.FromScriptCode() and it’s working properly. The problem I have is if I want to add a second document, I cannot call this method since it replace the current script with the second one. Is there a way to have multiple documents loaded from database, so no .cs file with ScriptRun.

Thank you!


You can use ScriptSource. Files collection in case your script consists of multiple sources.

In case you don’t have physical files on the disk, the content of these files can be loaded from other source (application resources or the database), and provided to the Scripter using LoadFile method.

I’ve uploaded sample project demonstrating this approach here:


Thank you very much! It’s working very well! Thanks again for your great support!