 
 
 
 
 
 
Mathematica .Net/Link in an Asp.Net application
- To: mathgroup at smc.vnet.net
- Subject: [mg116945] Mathematica .Net/Link in an Asp.Net application
- From: "rpgprog at gmail.com" <rpgprog at gmail.com>
- Date: Sat, 5 Mar 2011 06:06:40 -0500 (EST)
I am using the Mathematica .Net/Link platform to create a web service
to format and calculate math problems. However I am unable to get it
working.
I create it using this code:
_Log.IpDebug("Starting the Kernel Link");
if (string.IsNullOrEmpty(_MathLinkArguments))
   _InternelKernel = MathLinkFactory.CreateKernelLink();
else
   _InternelKernel =
MathLinkFactory.CreateKernelLink(_MathLinkArguments);
_Log.IpDebug("Kernel Link Started");
_InternelKernel.WaitAndDiscardAnswer();
The value of _MathLinkArguments is -linkmode launch -linkname \"C:\
\Program Files\\Wolfram Research\\Mathematica\\7.0\\Math.exe\".
This piece of code is called from the Application_Start method of the
global.asax.cs file.
When it gets to the WaitAndDiscardAnswer() call it gives the server
error:
Error code: 11. Connected MathLink program has closed the link, but
there might still be data underway.
Note: The SampleCode given with the .NET/Link package (both a console
app and a WinForms app).
I tried making another page that where I copy/pasted the console app
code and that gave me the same error (the first time) then "Error
code: 1. MathLink connection was lost" whenever I refresh the page.

