Unable to open work file with IIS but work fine when run with VS

狂风中的少年 提交于 2019-12-12 04:16:46

问题


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"


回答1:


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.



来源:https://stackoverflow.com/questions/21188147/unable-to-open-work-file-with-iis-but-work-fine-when-run-with-vs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!