What if a C# snippet does not work when transliterated to IronPython?

Say you have a working piece of C# code. You want to include it in your IronPython app. So you transliterate it to IronPython code. And it stops working. What do you do? You might feel lost at this point since the IronPython code is “supposed” to work. You have the following options: The first…

0

IronPython cannot call AutomationElement.FromHandle

If you use IronPython to call AutomationElement.FromHandle, it will return null. This happens because FromHandle uses Assembly.GetCallingAssembly and expects to get a statically compiled assembly with references to the correct version of the UIAutomation libraries. However, since IronPython code gets compiled on the fly using Reflection.Emit and DynamicMethods, it confuses AutomationElement. This UIAutomation team knows…

4