【问题标题】:Allowing Access To Outlook Interop In Web Forms Project允许访问 Web 窗体项目中的 Outlook 互操作
【发布时间】:2012-03-23 11:25:26
【问题描述】:

我在使用 Web 表单项目的 IIS 权限和 Microsoft 的 Outlook 2010 互操作程序集方面遇到问题。

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

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.

【问题讨论】:

标签: c# asp.net iis permissions interop


【解决方案1】:

在做了更多研究之后,我决定使用互操作程序集是一个糟糕的选择。正如 Alexi 所说,它不能通过网络使用。

【讨论】:

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

      <system.web>  
          <authentication mode="Windows"/> 
          <identity impersonate="true"/>
      </system.web>
      

    【讨论】:

      猜你喜欢
      • 2016-07-18
      • 1970-01-01
      • 2016-10-15
      • 1970-01-01
      • 2015-07-03
      • 1970-01-01
      • 2021-08-30
      • 2013-01-26
      • 1970-01-01
      相关资源
      最近更新 更多