Failed to recover factory COM class CLSID

12

I developed an application on my pc that does the following: from an upload of a word document, it generates a new document with some basic information. To generate this information, it opens the template document, finds a tag that exists in that template, and replaces the content for each tag (3 in total). On my pc it worked perfectly, however, when I went to the server, it gets with the following image error.

Detail:belowStackTracethereisalinethatshowstheprojectpathofmypceventhoughtheapplicationisonanothercomputer.

ErrorText:

  

FailedtorecoverfactoryCOMClassesfromthecomponentwithCLSID{000209FF-0000-0000-C000-000000000046}duetothefollowingerror:80070005Accessisdenied.(ExceptionfromHRESULT:0x80070005(E_ACCESSDENIED)).

    

FailedtorecoverfactoryCOMclassesofthecomponentwithCLSID{000209FF-0000-0000-C000-000000000046}duetothefollowingerror:80070005Accessisdenied.(ExceptionfromHRESULT:0x80070005(E_ACCESSDENIED)).

    

Description:AnunhandledexceptionoccurredduringtheexecutionofthecurrentWebrequest.Examinethestacktraceformoreinformationabouttheerrorandwhereitoriginatedinthecode.

    

ExceptionDetails:System.UnauthorizedAccessException:COMfactoryrecoveryofCOMcomponentswithCLSIDfailed

asked by anonymous 13.03.2015 / 21:13

1 answer

5

Errors similar to this can occur due to the following factors:

  • Missing DLLs are not registered on the server
  • Do not have Office installed on the server.
  • Office installed is 32bit and 64bit server

However, if you are sure that everything is correct, you should have stopped setting something on the server according to these SOen responses:

Depending on the oldest response, follow these steps:

  • In the cmd or Win + r type:

    DCOMCNFG
    
  • If your server is in English:

    • Open Console Root > Component Service > Computers

    • Right-click My Computer and select Properties

    • Go to the COM Security > Launch and Activation Permissions and click Edit Default

  • If your server is in Portuguese:

    • Open Control Root > Component Services > Compilers

    • Right-click My Computer and select Properties

  • Go to the COM Security > and then click Edit Pattern ...

  • Click the Add button ( Add if it is English) and type in the text field IIS_IUSRS for example or add a service, something like: p>

      
  • Note:The IIS_IUSRS is an IIS user group

  •   
  • Note: On Windows Server 2003 the group is IIS_WPG

  •   
  • Click OK, but do not close the next screen

  • In this window that remains, check the options, as in the image:

  • ThenjustclickOkonthefollowingwindowsandclosewhateverisneeded,soitshouldwork.

  

I'meditingthequestionbecauseI'mstilltesting

Accordingtothemostrecentresponse:

ApparentlyaccordingtothesestepsyouwillonlygrantaccesstotheCOMofthedesiredspecific,howeverbecareful,justdowhatisrequestedhere:

  • InthecmdorWin+rtype:

    DCOMCNFG
  • IfyourserverisinEnglish:

    • OpenConsoleRoot>ComponentService>Computers>DCOMConfig
  • IfyourserverisinPortuguese:

    • OpenControlRoot>ComponentServices>Compilers>DCOMConfig
  • LookforthecomponentegMicrosoftWord97-2003Documentandright-clickonitandgotoproperties,forexample:

      

    If the desired component is not listed it is because you have the x86 version of Office and your operating system is 64bit, or because you do not have office installed or the components properly registered

  • Go to the Security

  • In the Permissions and Permissions Permissions areas, add IIS_IUSRS and permissions.

  • Then go to Ok

05.11.2016 / 02:45