locked
Error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)). RRS feed

  • Question

  • Hi,

    I am getting error related for ASP.Net authorization while displaying Microsoft Word Document in HTML. I had already given permission for Network, Network Services in DCOMCNFG --- Computer ---- My Computer ---- Microsoft Word Document. Kindly help me to resolve this permission error

    Server Error in '/' Application.

    Retrieving the COM class factory for component with CLSID {000209FF-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 {000209FF-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.

    Source Error:
    Line 17: public partial class Employer_jobseekerdetail : System.Web.UI.Page
    Line 18: {
    Line 19:     Microsoft.Office.Interop.Word.Application app = new Microsoft.Office.Interop.Word.Application();
    Line 20:     Microsoft.Office.Interop.Word.Document doc = new Microsoft.Office.Interop.Word.Document();
    Line 21:     DataSet ds = new DataSet();

    Thanks in Advance

    Regards

    Rajesh

    • Moved by Mike Feng Monday, February 4, 2013 10:59 AM
    Friday, February 1, 2013 9:44 PM

All replies

  • 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.

    In case there are lots of file or more files are to be added in future. Consider giving rights on folder.

    You can also try running ASP.Net from Admin account but that will pose security threat.


    Thanks, Durgesh Chaudhary. http://home.techphernalia.com

    Monday, February 4, 2013 10:06 AM