asp.net - MATLAB Builder NE 在 IIS 7.5 上导致应用程序池崩溃

标签 asp.net iis matlab matlab-deployment

我正在使用 ASP.NET 为 MATLAB 函数开发 Web 用户界面。我开始研究演示并遇到这样的问题。

我使用 MATLAB 2010a 的部署工具创建了一个 MyComponent.dll 程序集,目标框架 - 3.5。该组件有一个函数 GetKnot(),它返回一个图形。

function df = getKnot()
    f = figure('Visible', 'off');
    knot;
    df = webfigure(f);
    close(f);
end

然后我在visual studio 2008 sp1中制作了简单的webapp,只有一页Default.aspx。 我添加了对 MWArray.dll、WebFiguresService.dll 和 MyComponent.dll 的引用。 后面的代码是:

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();
        }
    }
}

当我在 Visual Studio 的开发 Web 服务器上运行此页面时 - 一切都很好,图形工作正常。

但是当我尝试在我的本地 iis 7.5(在 Win7 x32 上运行)上部署 webfigure 时 - iis 应用程序池崩溃。系统事件日志中有一条条目“为应用程序池‘Classic .NET AppPool’提供服务的进程与 Windows 进程激活服务发生致命通信错误。进程 ID 为‘3676’。数据字段包含错误号 6D000780”。当 MyComponent 实例化时会发生这种情况。

迁移到 IIS 后我可能会忘记什么?

其他示例,例如幻方控制台应用程序,运行完美,每个 matlab 组件都实例化,但不在 IIS 环境中。

编辑:我部署了一个使用 Windows 7 和 MATLAB 2009b 的虚拟机,并尝试了相同的示例。一切正常。 :(。也许是 MATLAB 2010 问题?

最佳答案

我遇到了同样的问题(MCR 在 Windows Server 2008 中导致 AppPools 崩溃)。这似乎是 MCR 和 IIS 7 之间的问题。联系 Mathworks 支持后,他们告诉我这是由 MCR 中的错​​误引起的(与“NetworkService”AppPool 身份的权限有关)。我收到了以下建议:

To work around the issue, you could use either of the following 2 steps:

  1. Create an environment variable named MATLAB_PREFDIR and let it point to a directory where NETWORK SERVICE has write access. Or,

  2. 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).

我应用了第二个建议,它解决了我的问题。我希望这对遇到同样问题的其他人有所帮助。

关于asp.net - MATLAB Builder NE 在 IIS 7.5 上导致应用程序池崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2940791/

相关文章:

c++ - 有人使用 MATLAB 工具生成 C/C++ 代码吗?生成的代码是否可用于生产用途?

open-source - 开源(或其他)版本的 Matlab 工具箱

asp.net - 如何撤销/无效/取消旧的电子邮件确认 token (身份)

asp.net - 在 64 位操作系统上以 32 位运行 IIS 与以 64 位运行 IIS 有何优缺点?

asp.net - HTTPHandler 和 IsReusable 与 WebHandler

iis - 浏览器中的 Visual Studio 2013 查看项目出现内部服务器错误

c# - IIS 中创建的线程能否通知其超时?

debugging - Matlab如何进入 Debug模式?

c# - MVVM 在两个 View / View 模型之间传递数据

部署后 ASP.Net Core Identity 登录状态丢失