How can I set the value of a variable inside an IronPython scope to None from C# using ScriptScope.SetVariable without using ScriptEngine.ExecuteAndWrap("x = None", scope)? Does the variable need to already be defined within the ScriptEngine/ScriptScope? This example did not work:
// Note: "scope" is the ScriptScope variable assigned beforehand
scope.SetVariable("x", null);
web search found this related link but it did not provide a solution:
http://lists.ironpython.com/pipermail/users-ironpython.com/2009-June/010605.html
As far as I know the keyword
objectis just an alias forSystem.Object, but I found that castingnulltoSystem.Objectworked in some cases.