[IronPython] Embedded IronPython in .NET C# WinForm app error

Curt Hagenlocher curt at hagenlocher.org
Mon Jul 14 02:38:11 CEST 2008


80004002 is an HRESULT that's E_NOINTERFACE.  It's coming from the COM
component itself and not from IronPython.  One possible explanation is that
the component isn't compatible with the apartment model of the current
thread. Try changing from MTA to STA (or vice versa) and seeing if that
resolves the problem.

On Tue, Jul 8, 2008 at 4:56 AM, Mitch Barnett <mbarnett at uniserve.com> wrote:

> Hello,
>
> I have a .NET C# WinForm application that hosts an IronPython 1.1 engine.
> In the WinForm app, the scripting API is exposed through a web service
> interface (using Windows Communication Foundation) so that from a remote
> console, (over WCF), I can execute IronPython code on the computer that is
> running the WinForm app.
>
> The project is at: http://www.codeplex.com/gsb
>
> Works 99% of the time, but the 1% of the time that it does not work is for
> cases like this:
>
> >>> IronPython 1.1 (1.1) on .NET 2.0.50727.1433
> >>> import clr
> >>> import sys
> >>> sys.path.append(r"c:\projects\gsbservice\gsbservice1")
> >>> clr.AddReferenceToFile("AgentServerObjects.dll")
> >>> from AgentServerObjects import *
> >>> a = AgentServerClass()
> Traceback (most recent call last): File C:\Projects\GSBService\GSBService1
> \ParseInteractive.cs, line 93, in CallIPCmd File , line 0, in <stdin>##21
> File , line 0, in DefaultNew##22 File , line 0, in .ctor##26 TypeError:
> Creating an instance of the COM component with CLSID
> {D45FD2FC-5C6E-11D1-9EC1-
> 00C04FD7081F} from the IClassFactory failed due to the following error:
> 80004002.
> >>>
>
> Of course if I try the same thing using the IPY.exe console on the same
> computer, using the same AgentServerObjects.dll, it works just fine.
>
> Any thoughts appreciated as to what might be going wrong.
>
> Thanks,
>
> Mitch
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20080713/3fd26c8e/attachment.html>


More information about the Ironpython-users mailing list