Interop.Word Class Execution Failure

0

I'm trying to debug a problem in a REST API I've built in .Net MVC.

In it, I'm trying to use the Microsoft.Office.Interop.Word library to do document manipulation. My application works just fine on my local development box. But, when I run it on the server (after a publish), it bombs with this message...

Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).

...on the following line:

var application = new Application();

This is where it first instantiates an instance of Interop.Word.Application(), which is the first part of my application that interacts with the Interop.Word library. My research (and common sense) has led me to believe that there is some sort of a dependency that is present on my development machine, but is missing on the target server. I'm essentially trying to figure out what that is. I have found several message boards and articles and what-have-you on this site as well as others that have suggested an array of solutions from messing with DCOM settings (Couldn't find Microsoft Word Document in DCOM Config), to upgrading MS Office on the server. None of that seems to work. I've even seen someone suggest using a third-party component like GemBox. But, having to use a third-party solution doesn't seem necessary seeing as how my application works just fine locally. There has to be something missing on the server... some variation in the environment. This cryptic error is not doing me any favors.

Does anyone have any suggestions... something I'm overlooking or that I can try? Thanks!

c#
asp.net-mvc
office-interop
asked on Stack Overflow Feb 15, 2017 by Christine • edited May 23, 2017 by Community

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0