2012-03-05 56 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> 
    
相關問題