I don't know if I missed a conclusion to this but there is a general way to get a CodeContext. A CodeContext is just a Scope and a LanguageContext. You can new up an empty scope and you can get a LanguageContext from HostingHelpers.GetLanguageContext. But all of this breaks the remoting story. If that's an issue for you there's always HostingHelpers.CallEngine which will give you the LanguageContext and run your code in the ScriptRuntime's app domain.
But more on point you could also look at RuntimeHelpers.GetDynamicStackFrames which might give you the information you want w/ an easier to use interface from C#. If there's an interesting exception related goal in here we could look at adding it to the ExceptionOperations class. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Huzaifa Sent: Saturday, August 23, 2008 8:31 PM To: [email protected] Subject: Re: [IronPython] CodeContext I am try to get traceback object , for that i am trying different things Tomas Matousek wrote: The class might be actually be called ExceptionService in your bits. It was renamed recently. Tomas -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tomas Matousek Sent: Saturday, August 23, 2008 7:53 PM To: Discussion of IronPython Subject: Re: [IronPython] CodeContext Does ExceptionOeprations class provide you the information you need or is something missing? You can get an instance via engine.GetService(). Tomas -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Huzaifa Sent: Saturday, August 23, 2008 4:56 PM To: [email protected] Subject: [IronPython] CodeContext how to get CodeContext from ScriptRuntime ,ScriptScope or ScriptEngine . basically i am try use this function: public static PythonTuple/*!*/ GetExceptionInfoLocal(CodeContext/*!*/ context, Exception ex) -- View this message in context: http://www.nabble.com/CodeContext-tp19126500p19126500.html Sent from the IronPython mailing list archive at Nabble.com. _______________________________________________ Users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ________________________________ View this message in context: Re: CodeContext<http://www.nabble.com/CodeContext-tp19126500p19127475.html> Sent from the IronPython mailing list archive<http://www.nabble.com/IronPython-f14449.html> at Nabble.com.
_______________________________________________ Users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
