NetOffice getting 80080005 Server execution failed

0

I'm trying to edit a Word document programmatically. However, when I debug and first try to create the Word.Application, I get

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

I see that Word.Interop isn't supported anymore, so I started using NetOffice, but nothing changed, so perhaps I'm not altering the underlying functionality.

I have tried many DCOM configurations and am running my Visual Studio instance as Administrator, but nothing changes. Currently Authentication Level is None, I specify "This user" and am using an account with all the Security permissions. I've also tried the interactive user and the launching user previously. I've never had trouble with the debugger before, just once it was deployed on the server, so this is confusing to me.

I'm running Windows 8.1 (64-bit) and Office 2013 (32-bit). I'd appreciate any ideas. And does NetOffice matter at all for this problem? Thank you.

c#
.net
com
office-interop
netoffice
asked on Stack Overflow Aug 4, 2017 by erosebe • edited Aug 4, 2017 by erosebe

1 Answer

0

See You may receive an "Error code 80080005 -- server execution failed." error message when you start many COM+ applications.

Anyway, Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. Or, you should try to find alternatives that allow at least part of the code to run client-side. If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. Additionally, you will be taking risks with the stability of your overall solution. Read more about that in the Considerations for server-side Automation of Office article.

Consider using Open XML SDK if you deal with open XML documents only, see Welcome to the Open XML SDK 2.5 for Office for more information. Or just try to use any third-party components components designed for the server-side execution.

P.S. NetOffice will not help you to avoid such issues because it is based on the COM Automation technology.

answered on Stack Overflow Aug 7, 2017 by Eugene Astafiev

User contributions licensed under CC BY-SA 3.0