无法打开工作文件与IIS但与VS运行正常工作 [英] Unable to open work file with IIS but work fine when run with VS

查看:102
本文介绍了无法打开工作文件与IIS但与VS运行正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我停留在非常奇怪的问题。
我在做什么是通过Miscrosft办公室DLL

打开一个文件

  Microsoft.Office.Interop.Word.Application appWord =新Microsoft.Office.Interop.Word.Application();
    wordDocument = appWord.Documents.Open(C:\\\\ aa.docx);

enery的事情是工作的罚款,直到我运行从Visual Studio我的应用程序,但是当我通过IIS运行它thne wordDocument 空正在添加

我认为这是配股,但不知道磨到斗。我的网站应用程序池身份是本地系统


解决方案

通常有两个问题:


  

      
  1. 您还没有安装IIS机器上的Office

  2.   
  3. 您必须指定文件的访问权限。

  4.   

有是你应该考虑的另一件大事:Word中互操作建议不要在IIS进程。请参见的微软文档。

am stuck in very strange issue. What i am doing is opening a file through Miscrosft Office DLL

Microsoft.Office.Interop.Word.Application appWord = new Microsoft.Office.Interop.Word.Application();       
    wordDocument = appWord.Documents.Open("C:\\aa.docx");

enery thing is working fine till i run my application from visual studio, but when i run it through IIS thne wordDocument comming null.

i think it is rights issue but dont know whet to doo. My web site app pool identity is "LocalSystem"

解决方案

Usually there are two issues:

  1. You haven't installed Office on the IIS machine
  2. You have no access to the file specified.

There is another big thing you should consider: Word interop IS NOT RECOMMENDED on an IIS process. See this Microsoft document.

这篇关于无法打开工作文件与IIS但与VS运行正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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