I have created an Asp.Net web application that uses the Microsoft Visio application to perform certain functions. I have also installed Microsoft Visio 2019 on the server. To implement this functionality, I have utilized the Microsoft Office Interop Visio Library. Everything is functioning perfectly on my local machine, however, when I attempted to deploy it, I encountered a permission issue that was followed by an error message.
Based on suggestions provided by the Microsoft forum, I have attempted the following solutions:
Open DCOMCNFG and right-click on My Computer to select properties.
Go to the COM Securities tab.
Add "IIS_IUSRS" to Access Permissions and provide full permission.
Add "IIS_IUSRS" to Launch and Activation Permissions and provide full permission.
Change the user to an interactive user (Only works if I am logged in to the server) in the Identity tab.
Use "This user" with Admin account credentials, however, this did not work and resulted in an RPC Failed error message.
The problem persisted even when the user logged out from a remote connection.
Sometimes, I also received the following error message:
Retrieving the COM class factory for component with CLSID {00021A20-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)
I have tried adding Network Service users, EVERYONE, ANONYMOUS users, and so on to the security tabs, but to no avail.
Microsoft does not recommend or support server-side Automation of Office. To avoid performance and stability issues and ensure compliance with software license agreements, Microsoft recommends that developers use other suitable tools and technologies on the server side, such as the Open XML SDK, rather than relying directly on Office's server-side automation.
Microsoft has an article regarding this:
https://learn.microsoft.com/en-us/office/client-developer/visio/how-to-manipulate-the-visio-file-format-programmatically