I&#39;m not sure if this helps, but I use a C# class in my IronPython, and it works fine.<div><br></div><div>Class is defined using the shorthand get; set;</div><div><br></div><div>ie:</div><div><br></div><div><div>public class ScreenTags</div>
<div>    {</div></div><div><div>        public String appWindowName { get; set; }</div><div>        public String fieldName { get; set; }</div><div>        public bool isDataField { get; set; }</div><div>        public bool isManual { get; set; }</div>
<div>        public String screenLabel { get; set; }</div><div>        public String description { get; set; }</div><div>}</div><div><br></div><div>(In actuality, it is a lot more than this, consisting of other classes, methods, etc...)</div>
<div><br></div><div>Now, it may be bad practice, but I then simply use an object reference in Python, and assume it was instantiated. In other words, as far as Python is concerned, there is an instantiated object of ScreenTags called &quot;screen&quot;.</div>
<div><br></div><div>Python simply calls this whenever it wants to do something: </div><div><br></div><div>ie. screen. appWindowName  = &quot;ThisName&quot;</div><div><br></div><div>I create the screen object in my C# code, and then add it as a reference to the python scope before I call the IronPython engine. So, on the C# side I:</div>
<div><br></div><div><div>                scptEngine = Python.CreateEngine();</div><div>                scptRuntime = scptEngine.Runtime;</div><div>                scptScope = scptEngine.CreateScope();</div><div>                AddAssemblies(scptRuntime);       // call if you need to add other libraries, such as my class</div>
<div><br></div><div>And before I actually call the Engine, I set the class in the Python scope -- still in C#:</div><div><br></div><div><div>                ScreenTags SOA_screen = new ScreenTags();</div><div>                scptScope.SetVariable(&quot;screen&quot;, SOA_screen);</div>
<div>                scptSource = scptEngine.CreateScriptSourceFromFile(scriptFile);  // scriptFile is Python code</div><div>                scptSource.Execute(scptScope);</div><div><br></div><div>This is working fine. The class is actually really a loaded class, and it has all kind of goodies in it (ie pop up Windows forms, calls out to unmanaged code... all sorts of stuff). I never have a problem with any of it.</div>
<div><br></div><div>I don&#39;t know if this helps (or even if it is good practice!) but it is working here.</div></div></div><div><br></div><div><br></div></div>