Message Boards Message Boards

Error when integrating Free Wolfram Engine with .net application

Posted 5 years ago

Hi, I'm new to Wolfram. I downloaded yesterday Wolfram Engine 12.0 and tried to call it from my .net app in C# but I ended up with error where it asked me to choose a Mathlink program to launch.

the error in my program raise at this point : IKernelLink ml = MathLinkFactory.CreateKernelLink();

can someone advice on what is missing here. thanks in advance.

ps : I using Wolfram.NETLink.dll and ml32i4.dll

enter image description here

POSTED BY: Arcondo Dasilva
5 Replies

I think you need to specify the location of 'wolfram.exe':

https://reference.wolfram.com/language/NETLink/ref/net/Wolfram.NETLink.MathLinkFactory.CreateKernelLink_overload_3.html

With the Wolfram Engine in the default installation location it would be:

"c:/program files/wolfram research/wolfram engine/12.0/wolfram.exe"

(I didn't try this, but I think this is the direction to look into)

POSTED BY: Arnoud Buzing

Thanks a lot Arnoud. That was the error. I added the args :

string[] mlArgs = { "-linkmode", "launch", "-linkname", "c:/program files/wolfram research/wolfram engine/12.0/wolfram.exe"};
KernelLink ml = MathLinkFactory.CreateKernelLink(mlArgs);

to locate "worfram.exe" and it worked ! Now I can move further.

Kr,

POSTED BY: Arcondo Dasilva

Great to hear!

POSTED BY: Arnoud Buzing

Hi Arnoud, I have also the same problem as above: DllNotFoundException: Die DLL "ml32i4.dll": Das angegebene Modul wurde nicht gefunden. (Ausnahme von HRESULT: 0x8007007E) kann nicht geladen werden.

Even after I have inserted the corresponding lines: string[] mlArgs = { "-linkmode", "launch", "-linkname", "c:/Programme/Wolfram Research/Mathematica/12.2/MathKernel.exe" }; IKernelLink ml = MathLinkFactory.CreateKernelLink(mlArgs);

I'm using MATHEMATICA 12.2.0.0 Windows (64-bit) Visual Studio 2019 Version 16.7.5 and .NET 4.8

Why the RunTime is looking for ml32i4.dll and not for ml64ia.dll?

Kind regards

POSTED BY: Peter Leibundgut

Don't look further, the answer is: The developer comments that the ml32i4.dll file is missing from the NETLink directory since version 12.1.

Please find the dll file in link below. If you put an ml32i4.dll file in there, next to the existing ml64i4.dll file, things will work. https://amoeba.wolfram.com/index.php/s/R27S4gdL9WxcnnE

POSTED BY: Peter Leibundgut
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract