System.Runtime.InteropServices.COMException(0x800A1436) [英] System.Runtime.InteropServices.COMException (0x800A1436)

查看:103
本文介绍了System.Runtime.InteropServices.COMException(0x800A1436)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在尝试使用MVC应用程序上的Office Interop Services打开驻留在共享驱动器上的Word模板.该解决方案在本地运行,但是一旦部署到服务器,则会显示以下消息:

We are trying to open a Word template which resides on a Shared Drive using Office Interop Services on an MVC application.The solution is working locally, but once is deployed to the server the following message appears:

The File was not created: System.Runtime.InteropServices.COMException (0x800A1436): This file could not be found

ApplicationPool在域用户帐户下运行,该帐户已对共享驱动器具有权限.

ApplicationPool is running under a domain user account which already has permissions on the shared drive.

有什么建议吗?

推荐答案

您可以考虑使用Open XML SDK处理开放XML文档(.docx),请参见

You may consider using the Open XML SDK for dealing with open XML documents (.docx), see Welcome to the Open XML SDK 2.5 for Office. Or any other third-party components designed for the server-sider execution (for example, Aspose).

Microsoft当前不建议并且不支持从任何无人参与的非交互客户端应用程序或组件(包括ASP,ASP.NET,DCOM和NT Services)自动化Microsoft Office应用程序,因为Office可能表现出不稳定在这种环境中运行Office时的行为和/或死锁.

Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

如果要构建在服务器端上下文中运行的解决方案,则应尝试使用对无人值守执行安全的组件.或者,您应该尝试找到允许至少部分代码在客户端运行的替代方法.如果您使用服务器端解决方案中的Office应用程序,则该应用程序将缺少许多成功运行所需的功能.此外,您将承担整体解决方案稳定性的风险.在中了解有关此内容的更多信息.有关服务器端Office自动化的注意事项一文.

If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. Or, you should try to find alternatives that allow at least part of the code to run client-side. If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. Additionally, you will be taking risks with the stability of your overall solution. Read more about that in the Considerations for server-side Automation of Office article.

这篇关于System.Runtime.InteropServices.COMException(0x800A1436)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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