none
ASP.Net 3.5 application cannot able to access Word interop component when web server is logged off. RRS feed

  • Question

  • 0

    The error displayed is "Retrieving the COM class factory for component with CLSID
    {000209FF-0000-0000-C000-000000000046} failed due to the following error: 8000401a". This error is occurred at following line in ASP.Net code.

    Microsoft.Office.Interop.Word.ApplicationClassobjWord =newMicrosoft.Office.Interop.Word.ApplicationClass();

    Description: When web server is logged on with administrator user ccount, then this works perfectly. Web server (Windows Server 2008 R2) have Microsoft office 2010 with IIS 7.0 installed. We have configured word com  on web server with following settings:

    Local Security Policies


    1. Start -> Control Panel -> Administrative Tools -> Local
      Security Policy
    2. Navigate to Security\Local Policies\Security Options
      1. Network Access: Let everyone permissions apply to anonymous users
        - Set to Enabled
      2. DCOM: Machine Access Restrictions - Add Anonymous, Everyone,
        Interactive, Network, System with full rights options set
      3. Network Access: Sharing security model for local accounts - Set to
        Classic

    DCOM Configuration

    1. Click Start -> Run
    2. Enter DCOMCNFG and press OK. This will open the DCOMCNFG window.
    3. Browse down the tree to Console Root -> Component Services
      -> Computers -> My Computer
    4. Right click on "My Computer" and select properties
    5. Select the "Default Properties" tab
      1. Enable Distributed COM on this computer - Option is checked
      2. Default Authentication Level - Set to Connect
      3. Default Impersonation Level - Set to Identify
    6. Select the "COM Security" tab
    7. Click on Access Permissions ' Edit Default
      1. Add "Anonymous", "Everyone",
        "Interactive", "Network", "System" with Local and
        Remote access permissions set
    8. Click on Launch and Activation Permissions ' Edit Default
    9. Add "Anonymous", "Everyone",
      "Interactive", "Network", "System" with Local and
      Remote access permissions set
    10. Click on OK
    11. For 32-bit: Set the DCOM Config Setting for "Microsoft Office
      Word 97 - 2003 Document" 


      Console Root -> Component Services
      -> Computers -> My Computer -> DCOM Config -> Microsoft Office Word
      97 - 2003 Document



    (Open the properties > Identity Tab
    > Select "The interactive User"    Security Tab
    > Launch and Activation Permissions > Add IUSR_<machine name> (for
    XP) Network Service (for VISTA), Save the settings

    For 64-bit: Set the DCOM Config Setting
    for "Microsoft Office Word 97 - 2003 Document”

    Start -> Run -> mmc -32 -> File
    -> Add Remove Snap-in ->Component Services ->Add -> OK ->
    Console Root -> Component Services -> Computers -> My Computer ->
    DCOM Config -> Microsoft Office Word 97 - 2003 Document

    (Open the properties > Identity Tab
    > Select "The interactive User"    Security Tab
    > Launch and Activation Permissions > Add IUSR_<machine name> (for
    XP) Network Service (for VISTA), Save the settings

    Close the DCOMCNFG window

    Wednesday, March 7, 2012 9:06 AM

Answers