Access Denied Error 80070005 with DCOM in .NET 4.8 Web Applications on Windows Server 2022

Eric Ng 0 Reputation points
2024-03-25T07:27:07.27+00:00

I am experiencing an issue with the Distributed Component Object Model (DCOM) in a server environment where multiple web applications interact with Microsoft Office documents. Below are the details and steps that led to the problem:

Environment:

  • Server OS: Windows Server 2022 Standard
  • Development OS: Windows 10 Enterprise LTSC
  • Framework: .NET Framework 4.8
  • Hosting: IIS (Internet Information Services)
  • Libraries: Microsoft.Office.Interop.Excel, Microsoft.Office.Interop.Word

Issue:

When one application uses DCOM to open a Word or Excel file, other applications fail to open their respective documents using DCOM, even after the initial application has stopped using DCOM. The error persists until the server is rebooted.

Error Message:

(Excel): Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).

(Word): Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).

Steps to Reproduce:

  1. Application A opens a Word/Excel file using DCOM.
  2. Application B attempts to open a Word/Excel file using DCOM while Application A is running or after it has stopped.
  3. Application B encounters the access denied error.

Attempted Solutions:

  • Rebooting the server temporarily resolves the issue until DCOM is used again.
  • The error does not occur on my development machine running Windows 10.

Questions:

  1. What could be the root cause of the DCOM access denied error in a server environment but not on a development machine?
  2. How can I resolve the competition between different DCOM applications without rebooting the server?

Any insights or solutions to this persistent DCOM access issue would be greatly appreciated.

Office
Office
A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.
1,289 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,086 questions
0 comments No comments
{count} votes