[IronPython] strange runtime error hosting Iron Python in C# app

Matthew Swank matt at wecollectmore.com
Mon Apr 2 15:02:44 PDT 2007


Given a set of classes in a c# Library like the following:

 

    public interface IFoo

    {

        int Bar { get;}

    }

 

    public abstract class FooBase : IFoo

    {

        public abstract int Bar { get;}

    }

 

    public class FooConcrete1 : FooBase

    {

        public override int Bar { get { return 1; } }

    }

 

and a C# consumer:

       public class FooUser

    {

        public static int FooInt(IFoo a)

        {

            return a.Bar;

        }

    }

 

if I call FooInt from Python I'll get: "We Encountered an error: expected
IFoo, got FooConcrete1".

 

I suspect the error stems from adding an assembly as a reference inside the
python code in addition to referencing it in the C# project.  If this is the
case, how do I make referenced assemblies visible to the hosted python
module w/o using AddReference.?

 

Thanks,

 

Matt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20070402/2f3008cc/attachment.htm 


More information about the users mailing list