Microsoft.Office.Interop.Outlook Not working on IIS 8

时光毁灭记忆、已成空白 提交于 2020-01-07 04:57:05

问题


using Microsoft.Office.Interop.Outlook is not working on local IIS but it is working on IIS express while debuging.but when i publish app it is not runing on IIS8.

        Application OutlookApplication = new Application();            
        MailItem email = (MailItem)OutlookApplication.CreateItem(OlItemType.olMailItem);
        email.Display();
        email.Recipients.Add("careers@acb.com; bilal@abc.com;");

Giving Exception on IIS not on localhost.

Exception: An exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll but was not handled in user code.

Please help me thanks.


回答1:


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.

You can read more about that in the Considerations for server-side Automation of Office article.



来源:https://stackoverflow.com/questions/27587955/microsoft-office-interop-outlook-not-working-on-iis-8

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