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?

Microsoft 365 and Office | Development | Other
Microsoft 365 and Office | Word | For business | Windows
Windows for business | Windows Server | User experience | Other
{count} votes

1 answer

Sort by: Most helpful
  1. AgaveJoe 30,491 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' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.