尝试从服务器访问时出现Outlook问题

本文关键字:Outlook 问题 访问 服务器 | 更新日期: 2023-09-27 18:29:39

实际上,我正在尝试访问Outlook Distribution Lists
当我尝试用Visual Studio运行本地PC时,它在本地PC上一切正常
但是,当我在Windows Server 2012host我的应用程序并尝试使用domain运行时,我得到了一个error
我用的是Outlook 2007
我在64位的Windows Server中安装了MS Office 201364 bit版本。

我的代码如下:

Microsoft.Office.Interop.Outlook.Application OApplicaiton = new Microsoft.Office.Interop.Outlook.Application();   
var outlook = new Application().GetNamespace("MAPI");
var folder1 = outlook.GetDefaultFolder(OlDefaultFolders.olFolderContacts);
System.Threading.Thread.Sleep(5000);
foreach (var curr in folder1.Items.OfType<DistListItem>())
{
  Cmb_GlobalLists.Items.Add(curr.DLName);
}

我的error是:

Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).

有人能帮我吗?PIA有什么关系吗?

尝试从服务器访问时出现Outlook问题

CO_E_SERVER_EXEC_FAILURE很可能是在应用程序和Outlook在不同的安全上下文中运行时引发的。任一应用程序是否以提升的权限运行(以管理员身份运行)?

启动Internet信息服务(IIS)
右键单击应用程序的虚拟目录,然后单击"属性"
单击"目录安全性"选项卡。在"匿名访问和身份验证控制"下,单击"编辑"
请确保未选中"匿名访问"复选框,并且仅选中"集成Windows身份验证"复选框
将ASP.NET配置为使用Windows身份验证和模拟,请在WebConfig中使用以下配置
。。。身份验证模式="Windows"/>身份模拟="true"/>…