[IronPython] cannot access protected member without a pythonsubclass

Bernat Ràfales Mulet brafales at tango04.net
Wed Jan 21 16:01:46 CET 2009

That solved the problem, I usually use internal unless its necessary to 
make something public, I didn't realize that the IronPython code is 
executed from another assembly.


Marty Nelson wrote:
> Your class is internal, do you mean "public class Serie"?
> -----Original Message-----
> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Bernat Ràfales Mulet
> Sent: Wednesday, January 21, 2009 5:25 AM
> To: users at lists.ironpython.com
> Subject: [IronPython] cannot access protected member without a pythonsubclass
> Hello,
> I'm trying to add scripting to an existing application in C#. My 
> approach is to provide some Wrapper classes, that are instantiated and 
> then passed to a python engine scope via the SetVariable method of the 
> scope class. The problem is that one of those wrappers has a public 
> property with the get and set methods, but when I try to access the 
> property in the Python Script I get this error:
> cannot access protected member ElementID without a python subclass of Serie.
> The Serie class is simple:
> using System;
> using System.Collections.Generic;
> using System.Text;
> namespace Tango04.DashBoard.Scripting.Wrappers
> {
>     class Serie
>     {
>         public string Name { get; set; }
>         public string ElementID { get; set; }
>     }
> }
> The Python code I use is as simple as this:
> ShowSerie = Serie.ElementID != 'somestring'
> I instantiate a Serie object, fill it with the data, and then pass it as 
> a variable to the script.
> Anyone knows what I'm doing wrong?
> Thanks!
> =======
> Notice: This e-mail message, together with any attachments, contains
> information of Symyx Technologies, Inc. or any of its affiliates or
> subsidiaries that may be confidential, proprietary, copyrighted,
> privileged and/or protected work product, and is meant solely for
> the intended recipient. If you are not the intended recipient, and
> have received this message in error, please contact the sender
> immediately, permanently delete the original and any copies of this
> email and any attachments thereto.
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: brafales.vcf
Type: text/x-vcard
Size: 351 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20090121/b37a3b56/attachment.vcf>

More information about the Ironpython-users mailing list