ILVisualizer 2010 Solution

The projects are set to be built against the .NET 4.0.

IronPython: System.Reflection.Assembly object

IronPython offers a little bit more love to the Assembly object instance: we can directly access the assembly’s top-level members (namespace, public type) via the dot operation. System.Reflection provides many ways to let you hold the assembly object, such as Assembly.Load method, Type.Assembly property, … For example, given assembly1.dll compiled from the C# file below,…


IronPython: System.Array

When you start interop’ing with .NET in IronPython, sooner or later, you will find that you are in need of creating an array as argument. There are mainly 2 ways to create array objects: Array with type indexing (for one-dimensional array object only), and classic reflection API: Array.CreateInstance System.Array indexing with a type creates a…


IronPython: ipyw.exe

Each IronPython binary release ships two executable files: ipy.exe and ipyw.exe. Their (only) difference is, ipy.exe is a console application and ipyw.exe is a windows application. So given the following, ## import clr clr.AddReference(“System.Windows.Forms”) from System.Windows.Forms import * class SimpleForm(Form): def __init__(self): self.Text = ‘Simple Winform’ Application.Run(SimpleForm()) Running it with ipy.exe will keep…


SignatureResolver (unfinished)

While writing the ILVisualizer for dynamic method late 2005, I’d like to show the local variable information as well; so I started working on the managed signature parser, at least to parse LocalVarSig (Ecma-335 23.2.6). It was 2+ years ago, and never got to a finished state. Now perhaps I will never spend more time…


ILVisualizer VS2008 solution

I attached the ILVisualizer VS2008 solution in this post. There is no source code update; the only change is to upgrade the Microsoft.VisualStudio.DebuggerVisualizers.dll reference from version to version Just for your convenience, so you can see a successful build after downloading in VS2008. Thanks Julien for leaving the instruction here.


IronPython: Accessing the .NET Field

The .NET libraries normally do not expose the public field, but we can still find its’ presence for certain scenarios. IronPython treats the .NET fields like python attribute. For python attribute, the typical operations are set, get and delete. In general, IronPython throws TypeError when deleting members of CLR types and their objects (so for…

VisualStudio as my IronPython editor

The following steps are what I did to get Visual Studio ready as my IronPython (and IronRuby) editor. Install the latest internal dogfood build of Visual Studio 2008. you may use Visual Studio 2005 or download the VS 2008 public beta2; Download and install ASP.NET futures release (July 2007). This will give me the nice…


IronPython: explicitly choose one method

C# allows method overloading. Given an argument list, the compiler performs the overload resolution to select the best method to invoke. The chosen method token is baked into the assembly. IronPython does the method resolution at the IronPython run time; for most scenarios, it has no problem in picking up the most reasonable one based…

IronPython: Provide (or not) Argument for by-ref Parameter

Python function may return multiple objects as a tuple. The .NET method can only return one object as the result of a call; in order to return more than one objects, by-ref parameters are needed. They are decorated with the parameter modifier (ref, out) in C#. Dictionary.TryGetValue(TKey key, out TValue value) has an output parameter…