2011-06-06 43 views
1

我使用ASP.NET代碼將PPT轉換爲圖像。當我直接運行我的代碼(不包含IIS 7.0)時,它的運行非常完美。但是,當我配置我的應用到IIS 7.0,然後運行它給我下面的錯誤應用:使用IIS 7.0的COM +對象

Retrieving the COM class factory for component with CLSID {91493441-5A91-11CF-8700-00AA0060263B} 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 {91493441-5A91-11CF-8700-00AA0060263B} 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. 

Source Error: 


Line 12:   ' Create an instance of PowerPoint, make it visible, 
Line 13:   ' and open Pres1.ppt. 
Line 14:   Dim oPP As New PowerPoint.ApplicationClass() 
Line 15:   oPP.Visible = MsoTriState.msoTrue 
Line 16:   Dim oPresSet As PowerPoint.Presentations = oPP.Presentations 


Source File: G:\Projects\PPTTest\Default.aspx.vb Line: 14 

Stack Trace: 


[UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {91493441-5A91-11CF-8700-00AA0060263B} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).] 
    _Default.PPT() in G:\Projects\PPTTest\Default.aspx.vb:14 
    _Default.Page_Load(Object sender, EventArgs e) in G:\Projects\PPTTest\Default.aspx.vb:8 
    System.Web.UI.Control.OnLoad(EventArgs e) +91 
    System.Web.UI.Control.LoadRecursive() +74 
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207 

請人幫我擺脫這種局面。我正在使用Windows Server 2008,帶有ASP.NET Framework 4.0的Visual Studio 2010,使用基於表單的身份驗證。

謝謝

+0

嗯......任何人都可以解決這個問題,或者如果不理解問題然後討論它。 – Zeeshan 2011-06-10 06:11:43

回答

0

它已被賦予權限爲「此用戶」解決了,然後給你登錄在COM +設置憑據。