MATLAB Builder NE crash apppool on IIS 7.5
I'm developing a web user interface for MATLAB functions with ASP.NET. I've started with studying demos and stucked with such problem.
I created a MyComponent.dll assembly with deploytool from MATLAB 2010a, target framework - 3.5. This component has one function GetKnot() which returns a figure.
function df = getKnot()
f = figure('Visible', 'off');
knot;
df = webfigure(f);
close(f);
end
Then I made simple webapp in visual studio 2008 sp1, with only one page Default.aspx. I added references to MWArray.dll, WebFiguresService.dll and MyComponent.dll. The codeBehind is:
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MyComponent;
using MathWorks.MATLAB.NET.WebFigures;
namespace MATLAB_WebApplication
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
var myComponentClass = new MyComponentClass();
var x = myComponentClass.getKnot();
WebFigureControl1.WebFigure = new WebFigure();
}
}
}
When I run this page on Visual Studio`s Development web server - everything is fine, figure works.
But when I`m trying to deploy webfigure on my local iis 7.5 which runs on Win7 x32 - iis app pool crashes. There is an entry in System Event Log "A process serving application pool 'Classic .NET AppPool' suffered a fatal communication error with the Windows Process Activation Service. The process id was '3676'. The data field contains the error number 6D000780". This happens when MyComponent is instantiating.
What I could forget when moved to IIS?
Other examples, like magic square console application, runs perfect, and every matlab component instantiating, but not in IIS environment.
Edit: I deployed a virtual machine with Windows 7 and MATLAB开发者_JS百科 2009b, and tried the same example. Everything works fine. :(. Maybe it`s MATLAB 2010 issue?
I ran into this exact same problem (MCR was crashing AppPools in Windows Server 2008). It appears to be an issue between the MCR and IIS 7. After contacting Mathworks support they informed me that this is caused by a bug in the MCR (pertaining to the permissions of the "NetworkService" AppPool identity). I received the following suggestions:
To work around the issue, you could use either of the following 2 steps:
Create an environment variable named MATLAB_PREFDIR and let it point to a directory where NETWORK SERVICE has write access. Or,
Create a new Application Pool which runs under the "LocalSystem" Identity (look under "Advanced Settings..." of the Application Pool). Then configure your Application to use this Application Pool ("Basic Settings..." of your Application).
I applied the second suggestion and it fixed my problem. I hope this is helpful to someone else out there running into the same issue.
精彩评论