views:

45

answers:

2

I have a class (e.g. MksMath) written in IronPython using SharpDevelop 3.2. After compiling it for class library, it produced the following output:

IronPython.dll
IronPython.Modules.dll
Microsoft.Dynamic.dll
Microsoft.Scripting.Core.dll
Microsoft.Scripting.Debugging.dll
Microsoft.Scripting.dll
Microsoft.Scripting.ExtensionAttribute.dll
mksmath.dll

If I try to add reference to all above dll and import "MksMath", I am unable to access it. The vbc is throwing the following error:

Namespace or type specified in the Imports 'MksMath' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

I am new to IronPython. Kindly advise how to use this class in my vb.net code?

A: 

Here is a link that I think may solve the issue. http://msmvps.com/blogs/theproblemsolver/archive/2008/08/14/calling-ironpython-functions-from-net.aspx

Wade73
Thanks for the link. I followed the link posted by Lucas and solved the issue.
M K Saravanan
+1  A: 

I post here my answer that I posted to IronPythopn mailing list :-)

You cannot use mksmath.dll directly from VB (see Compiling Python code into an assembly) so you have to host IronPython engine in your VB app and use mksmath.dll from the engine. See Using Compiled Python Classes from .NET/CSharp IP 2.6 for example (in C#).

Lukas Cenovsky
Thanks Lucas :-)
M K Saravanan