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

Marcel Heing-Becker marscel at googlemail.com
Mon Dec 28 13:36:49 CET 2009


PLEASE IGNORE MY PREVIOUS POST with the same title, I accidentally sent it
before I was finished cleaning up the code.

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(fooclass):
    def __init__(self):
        Name = "Unused"
    ...

barobject = bar()

Well, I can't really say what this is about. Is it a Bug in IP or anything
like a limitation?
Greetings, Marcel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20091228/6ee4fea5/attachment.html>


More information about the Ironpython-users mailing list