2012-03-05 24 views
1

我遇到了使用Web窗体项目的IIS权限和Microsoft的Outlook 2010互操作程序集的问题。允许在Web窗体项目中访问Outlook Interop

我创建了一个概念验证项目,以确保我可以在特定的任务中使用Microsoft的Outlook互操作程序集。演示项目运行良好,我没有任何问题。现在我正在尝试将它集成到我们的主项目中,并且遇到了IIS权限问题。我的网站在本地运行在IIS 7中。在IIS管理器中,我单击应用程序池 - >我的网站 - >高级设置。在这个窗口中,我有一个名为“fileshare”的自定义标识,它带有一个密码(“fileshare”是为了在开发网络服务器上安全访问网站图像,pdf文件等而创建的)。我将Outlook互操作程序集复制到我们的公共共享程序集文件夹中,而不是从GAC中引用它。我给了程序集IUSER,NETWORK SERVICE,IIS_WPG,ASP.NET和fileshare的所有权限。我得到以下运行时错误:

Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000- 
C000-000000000046} failed due to the following error: 80070005 Access is denied. 
(Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)). Description: An unhandled 
exception occurred during the execution of the current web request. Please 
review the stack trace for more information about the error and where it 
originated in the code. 

Exception Details: System.UnauthorizedAccessException: Retrieving the COM class 
factory for component with CLSID {0006F03A-0000-0000- C000-000000000046} failed 
due to the following error: 80070005 Access is denied. (Exception from HRESULT: 
0x80070005 (E_ACCESSDENIED)). 

ASP.NET is not authorized to access the requested resource. Consider granting 
access rights to the resource to the ASP.NET request identity. ASP.NET has a 
base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on 
IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that 
is used if the application is not impersonating. If the application is 
impersonating via <identity impersonate="true"/>, the identity will be the 
anonymous user (typically IUSR_MACHINENAME) or the authenticated request user. 

To grant ASP.NET access to a file, right-click the file in Explorer, choose 
"Properties" and select the Security tab. Click "Add" to add the appropriate 
user or group. Highlight the ASP.NET account, and check the boxes for the 
desired access. 

我检查了Windows事件日志,并在Windows日志 - >系统和我有这样的错误:

The machine-default permission settings do not grant Local Activation permission 
for the COM Server application with CLSID {0006F03A-0000-0000- 
C000-000000000046} and APPID Unavailable to the user BSoup\fileshare SID 
(S-1-5-21-2999627215-1482540357-33300828-1019) from address LocalHost (Using 
LRPC). This security permission can be modified using the Component Services 
administrative tool. 
+0

你不应该......不支持的Outlook在服务器环境下运行 - 在这里http://msdn.microsoft.com/en-us/library/gg608200.aspx细节。 – 2012-03-06 00:08:35

回答

0

做了些研究后,我已经决定使用互操作程序集是一个不错的选择。正如Alexi所说,它不适用于网络。

0
  • 启动Internet信息服务(IIS)。
  • 用鼠标右键单击您的应用程序的虚拟目录,然后单击属性。
  • 单击目录安全性选项卡。在匿名访问和身份验证控制下,单击编辑。
  • 确保没有选中匿名访问复选框,并且集成Windows身份验证是唯一选中的复选框。
  • 将ASP.NET配置为使用带有模拟的Windows身份验证,请在WebConfig中使用以下配置。

    <system.web> 
        <authentication mode="Windows"/> 
        <identity impersonate="true"/> 
    </system.web> 
    
相关问题