0

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.

jlo-gmail
  • 4,453
  • 3
  • 37
  • 64

1 Answers1

0

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.

Matt Warren
  • 1,956
  • 14
  • 15
  • Whilst this may theoretically answer the question, [it would be preferable](//meta.stackoverflow.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. See [here](https://meta.stackexchange.com/a/94027/285661) for instructions how to write *better* "link-based" answers. – GhostCat Sep 01 '17 at 18:55