This project is read-only.

Debugging Hosted Scripts?

Apr 16, 2009 at 8:42 PM
Hi all,

We are interested in hosting a language, e.g., IronPython, in our C# program so that our business users can express complex business logic in code. I understand how to host a script engine, etc. What I am curious about is this...

Is it possible to create create a (rudimentary) debugger (or leverage an existing debugger) so that we can flag syntax errors, etc. in our script editing window? Does the scripting engine and/or DLR have debug access points, e.g., tells me if there is a syntax error and on what line it occurred, etc.? I'd prefer to do something like that vs. having the script simply fail when we try to programatically execute it.

Apr 16, 2009 at 9:08 PM

You can use ScriptSource.Compile with a custom error listener to get syntax errors:

public CompiledCode Compile(ErrorListener errorListener);