我在使用Web表单项目时遇到IIS权限和Microsoft的Outlook 2010互操作程序集的问题。
我创建了一个概念验证项目,以确保我可以在特定的情况下使用Microsoft的Outlook互操作程序集。演示项目运行良好,我没有遇到任何问题。现在我正在尝试将它集成到我们的主项目中,并且我遇到了IIS权限问题。我的网站在IIS 7本地运行。在IIS管理器中,我单击应用程序池 - >我的网站 - >高级设置。在这个窗口中,我有一个名为“fileshare”的自定义标识,其中包含一个密码(“fileshare”是为了安全访问开发网络服务器上的网站图像,pdf文件等而创建的)。我将outlook interop程序集复制到我们的公共共享程序集文件夹中,而不是从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日志下 - &gt;系统和我有这个错误:
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 :(得分:0)
在做了一些研究之后,我决定使用互操作程序集是一个糟糕的选择。正如Alexi所说,它不适用于网络。
答案 1 :(得分:0)
将ASP.NET配置为通过模拟使用Windows身份验证,请在WebConfig中使用以下配置。
<system.web>
<authentication mode="Windows"/>
<identity impersonate="true"/>
</system.web>