问题
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