What's MakeModule.py? Normally in v1.x if you do -X:SaveAssemblies or you use the pyc sample to compile a .py file you'll just be able to import it (like a .pyc file in Cpython). AddReference is used for normal .NET assemblies.
But from the exception this looks like 2.0 - and I don't know how you're compiling in that case. It could be that MakeModule.py is working against an older version of the hosting APIs and needs to be updated. If you want more information about the exception I suggest running w/ -X:ExceptionDetail and we'll give you the full .NET stack trace. But as of now IronPython 2.0 doesn't support compiling to an assembly it's self although we're currently looking into doing that. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Suma Talya Sent: Tuesday, February 26, 2008 3:47 AM To: users@lists.ironpython.com Subject: Re: [IronPython] Exporting Python code as an assembly Hi, I have a py file by name IronPythonDLL.py containing --------------------------------------------------------------- import clr import System import sys from ClrWrapper import ClrAttribute, ClrAccepts, ClrReturns class IronPythonClass: clr_namespace = 'IronPythonDLL' @ClrReturns(System.String) def IPyMethod(self): return "IronPython Method" --------------------------------------------------------------- I have created IronPythonDLL.dll using MakeModule.py Now through ironpython interpreter i tried creating an instance of the above class and got an error, >>> import clr >>> clr.AddReference('IronPythonDLL.dll') >>> import IronPythonDLL >>> o=IronPythonDLL.IronPythonClass() Traceback (most recent call last): File IronPythonDLL, line unknown, in .ctor File IronPythonDLL, line unknown, in InitClass File , line unknown, in ##26 TypeError: Value cannot be null. Parameter name: scriptSource Any help on this will be useful.... Thanks, -Suma. _______________________________________________ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com