为什么 ASP.NET Web App 在从 cmd 运行 .exe 时运行良好但从 IIS 引发错误? [英] Why ASP.NET Web App works well when run the .exe from cmd but throws an error from IIS?

查看:35
本文介绍了为什么 ASP.NET Web App 在从 cmd 运行 .exe 时运行良好但从 IIS 引发错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是关于 ASP.NET Web App 做简单的 Visio 办公自动化 - 将文件从 vsdx 转换为 svg.

It's about ASP.NET Web App that doing simple Visio Office Automation- convert file from vsdx to svg.

我已经知道不建议在 Microsoft 文档中的服务器端执行此操作 MS.但是,只有 Visio 才能正确转换我的复杂图表(Aspose 也是错误的转换).

I already know thet it's not recommended to do it on server side from the Microsoft documantation MS. But, only Visio convert my complicated diagrams correct (the Aspose also wrong convert).

该应用程序在我的 PC(Windows 10 企业版)上运行良好,从 VS 以 IISExpress/Project/Executable/IIS 启动时,甚至从 IIS 本身运行.但是,在服务器(Windows Server 2019 Standard)上,只有当我从 cmd 将它作为 exe 运行但从 IIS 中抛出错误(消息:发生异常".没有更多有用的信息)时,该应用程序才能正常工作以下几点:

The App works well on my PC(windows 10 Enterprise) by any way, from VS when launch as IISExpress/Project/Executable/IIS and even from the IIS itself. But, on the server(Windows Server 2019 Standard) the App works well only when i run it as exe from the cmd but throw an error (message: "An exception occurred". with no any more usefull info) from the IIS in the following point:

using Visio = Microsoft.Office.Interop.Visio;
Visio.InvisibleApp visioInvisibleApp = null;
...
Visio.Document doc = visioInvisibleApp.Documents.Open(vsdxSourcePath);

可能有什么区别?我怎样才能让它在 IIS 上运行?

请注意,它与关于此问题的所有其他问题略有不同,因为它已经在我的 PC 上在 IIS 上运行良好,但仅在服务器上运行不佳.

Please note that it's a little bit different from all others question on this issue in the fact that it's already works well on IIS on my PC and only dont works well on the Server.

推荐答案

终于!只是应该授予许可,通过:组件服务 ->计算机 ->我的电脑 ->DCOM 配置 ->Microsoft Visio 2003-2010 绘图

Finally! Just should grant a permissiom, by: Component Services -> Computers -> My Computer -> DCOM Config -> Microsoft Visio 2003-2010 Drawing

  1. 右键单击
  2. 属性
  3. 在安全"选项卡中 ->从使用默认值"更改到定制"共有 3 个选项.
  4. 在身份"选项卡中 ->更改为此用户"选项并填写您的详细信息.
  5. 申请&好的

现在 Office 应用程序(在我们的例子中是 Visio)应该可以工作了!

Now the Office App (Visio in our case) should work!

这篇关于为什么 ASP.NET Web App 在从 cmd 运行 .exe 时运行良好但从 IIS 引发错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆