locked
80070005 error RRS feed

  • Question

  • hi all,

    i m trying to use photoshop CS c# api with microsoft visual studio, for this reason i entered Interop.Photoshop.dll and Interop.PhotoshopTypeLibrary.dll from "Property Pages"->"References"->"Add Reference"->"COM". Everything looks fine until this moment. But when i m trying to use the application class e.g. "ps.ApplicationClass app = new ps.ApplicationClass();" (ps-> using ps = Photoshop; ) it throws me the error below:

     

    Server Error in '/' Application.


    Retrieving the COM class factory for component with CLSID {A1093992-8BEB-4307-943B-3FF7023AD1E2} failed due to the following error: 80070005.

    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 {A1093992-8BEB-4307-943B-3FF7023AD1E2} failed due to the following error: 80070005.

    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) 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 69:                         
    Line 70:                         
    Line 71:                         ps.ApplicationClass app = new ps.ApplicationClass();
    Line 72:                         app.Preferences.RulerUnits = ps.PsUnits.psPixels; //Change Ruler Unit to Pixels.
    Line 73:                         app.Documents.Add(320, 240, null, null, null, null, null); //Create new doc (320 x 240).

    Source File: G:\..\test_problem.aspx.cs    Line: 71

    Stack Trace:

    [UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {A1093992-8BEB-4307-943B-3FF7023AD1E2} failed due to the following error: 80070005.]
       test_problem.Page_Load(Object sender, EventArgs e) in G:\..\test_problem.aspx.cs:71
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
       System.Web.UI.Control.OnLoad(EventArgs e) +99
       System.Web.UI.Control.LoadRecursive() +47
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

    i have read many related posts to several forums but still i cant find a solution.

    thanx in advance,

    bob

    Monday, August 21, 2006 3:11 PM

Answers

  • oh. i found the solution in http://www.codeguru.com/forum/printthread.php?t=383912&page=3&pp=15

    In short:
    [...]
    I first opened DCOMCNFG from the command prompt, opened Component Services, expanded Computers/My Computer/DCOM Config. Then I Selected Microsoft Excel Application, and in the resulting dialog selected Security tab. Under Security Tab I changed Launch and Activation Permissions to customize, Access Permissions to customize and configuration Permissions to customize. And in the all the three I selected the ASPNET account.
    [...]

    worked for me!
    Wednesday, August 23, 2006 2:27 PM

All replies

  • i am getting the same error when trying to open an excel-workbook.

    have you or anybody else found a solution?
    Wednesday, August 23, 2006 2:00 PM
  • oh. i found the solution in http://www.codeguru.com/forum/printthread.php?t=383912&page=3&pp=15

    In short:
    [...]
    I first opened DCOMCNFG from the command prompt, opened Component Services, expanded Computers/My Computer/DCOM Config. Then I Selected Microsoft Excel Application, and in the resulting dialog selected Security tab. Under Security Tab I changed Launch and Activation Permissions to customize, Access Permissions to customize and configuration Permissions to customize. And in the all the three I selected the ASPNET account.
    [...]

    worked for me!
    Wednesday, August 23, 2006 2:27 PM
  •  hi,

    add this tag in web config
    <
    identity impersonate="true" userName="xxx" password="yyy"/>

    Thursday, July 3, 2008 5:01 AM
  • I too have the same problem, but i am trying with Microsoft Word. Tried to do what Cribe has said, I was able to change Launch and Activation Permissions to customize, Access Permissions to customize and configuration Permissions to customize. Once i apply and give ok, the Launch and Activation Permissions rollsback to Use Default. Also i am not sure how to set these for the ASPNET user. Any idea?
    Wednesday, June 10, 2009 6:35 AM
  • Next to the Customize there should be an EDIT button, click that, this will enable you to add the ASP.NET user and apply, and the defaults will not revert back

    However like yourself I have done what Cribe said but for WORD, and applied to rthe ASP.NET user but I still get the 8007005. Still looking for an answer!
    • Proposed as answer by claireeee Saturday, January 2, 2010 12:15 PM
    Wednesday, July 29, 2009 12:53 PM
  • if your account is administartor thats your problem.. you will need to make your account a standerd user.
    Saturday, January 2, 2010 12:16 PM
  • I also had this problem. Open DCOMCNFG. Under the tab "Default Security", "Default Launch Permission" section, click the button "Edit Default". Then click "Add", "Show Users". Choose "Allow Launch" under "Type of access" and select "ASPNET". Click "OK" everywhere to apply. It worked for me.
    Sunday, January 31, 2010 5:38 PM
  • Pl follow the belo steps for using COM Dll:

    1] Register the dll using regsvr32

    2] Add reference to the Dll in Visual Studio.NET

    3] Provide full access to ASPNET user under Security tab using DCOMCNFG, as disussed above.

    4] Go to the folder where Dll is stored. Right click on the Dll and give full rights to ASPNET user.

    5] Reset IIS just to be on the safer side.

    This should solve the problem.

     

    Tuesday, July 13, 2010 5:59 AM
  • You can also add IIS user to "Microsoft Office Word 97-2003 Document" component services, by the property "Security". I had this problem, I had added ASP Net user, but it didn´t work. So I added IUSR_....
    Friday, November 5, 2010 6:13 PM
  • Same problem attempting to access Microsoft Office PowerPoint via the COM object.

    Making a call to instantiate a PowerPoint application (C# code)  using:

    new  Microsoft.Office.Interop.PowerPoint.Application();Component Services shows "Microsoft Office PowerPoint Slide" in Component Services. Tried everything shown in this thread.


    Chuck

    Friday, October 19, 2012 5:46 PM