[IronPython] Internal Assembly Dependency

Bakalar, Matthew (NIH/CIT) [C] bakalarmh at mail.nih.gov
Wed May 26 20:33:41 CEST 2010


Hello All,
I am new to IronPython, relatively new to C#, and new to this list. I have a C# assembly that I am attempting to access from IronPython. I am able to load the assembly using:
clr.AddReferenceToFileAndPath(mypath)
without any problems. I can then import the classes that reside within my assembly as well, create instances of these classes, and call certain methods on these instances. There are methods within this assembly that rely on a reference to another assembly (MathNet.Iridium). When I attempt to call these methods from my IronPython script, I receive the following error:
IOError: [Errno 2] Could not load file or assembly 'MathNet.Iridium, Version=2008.8.16.470, Culture=neutral, PublicKeyToken=c061a3ec32cc0c6f' or one of its dependencies. The system cannot find the file specified.
Now, I never added a reference to MathNet.Iridium in my script. However, I assumed that the C# assembly that I am calling directly was compiled with a reference to this other assembly, and that I would not have to explicitly add a reference. When I create a test assembly entirely in C# that calls the assembly I am attempting to call, and do not include a reference to the MathNet.Iridium assembly, I am able to execute the code without problems. Do I need to add a reference to the MathNet.Iridium assembly from within my IronPython script even though I don't intend to access it directly?
Thanks
Matthew Bakalar

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100526/9e42f283/attachment.html>


More information about the Ironpython-users mailing list