How can a CSharpScript process to capture the output generated by a vbscript or cs-script?

154 views Asked by At

Is there a way for the hosting process to capture the output generated by a vbScript or cs-script when that script is run by CSharpScript(Rosslyn) ?

I am running a Rosslyn script in C#. I would like to log the Console or Trace output generated by the script. I expected something similar to OpenStandardOutput in System.Console, but am not finding it.

1

There are 1 answers

1
Matt Warren On

When your CSharpScript is executed it is simply running as code within your calling process. If you want to capture its output you can use the technique of starting a new process to run the script and redirecting its output.

Try this link.