[IronPython] Cannot create instances of RuntimeType because it has no public constructors

Marcel Heing-Becker marscel at googlemail.com
Mon Dec 28 04:22:00 PST 2009


Hi there,
I have a problem with my application. It's written in C# and embeds
IronPython. In C#, I have a class that looks like this:

public class foo
{
    public foo()
    {
        ...
    }
    ...
}

I put this into the ScriptScope I use by doing:

scope.SetVariable("fooclass", typeof(foo));

Operations like: a = fooclass() work without any problem, but the following
IronPython does not work and raises the error: Cannot create instances of
RuntimeType because it has no public constructors. Code:

class bar(foo):
def __init__(self):
Name = "Unused"

def TestFunction(self):
return "Juhu!"

ObjTileTypeUnused = TileTypeUnused()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20091228/7770fb1f/attachment.htm>


More information about the Users mailing list