ASP.Net Com-InterOp WORD issue after hosting in windows server

Murikkoli, Reshmi 0 Reputation points
2024-10-03T11:06:44.0166667+00:00

I have created a C#(.Net framework) API to convert Word to PDF using interop.word.dll. I have installed MS Office 2016 on the server. However, even when no one is logged on the server, I am getting the below exception.

"Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 8000401a The server process could not be started because the configured identity is incorrect. Check the username and password. (Exception from HRESULT: 0x8000401A"

Does anyone have any solution for this?

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,277 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
4,015 questions
Word Management
Word Management
Word: A family of Microsoft word processing software products for creating web, email, and print documents.Management: The act or process of organizing, handling, directing or controlling something.
935 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AgaveJoe 28,541 Reputation points
    2024-10-03T12:49:02.29+00:00

    Office automation (COM interop) is a desktop feature and not recommend for use on a server.

    https://support.microsoft.com/en-us/topic/considerations-for-server-side-automation-of-office-48bcfe93-8a89-47f1-0bce-017433ad79e2

    Alternatively, please suggest other options for converting Word files to PDF.

    Search NuGet for a Word to PDF .NET Framework library. There are a lot of libraries to choose from. Read the docs and find a solution that fits your needs.

    https://www.nuget.org/

    https://www.nuget.org/packages?q=Word+to+PDF

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.