Getting factory COM class for component with CLSID error: 8000401a

from the last so many times, I get the following error. Since I use Microsoft Word DLL files to create word files, which are then attached to the mail.

Server Error in '/' Application. Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 8000401a. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 8000401a. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [COMException (0x8000401a): Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 8000401a.] iPortal.user.sendRAMail.GetData(Object fileName) in XXX:512 iPortal.user.sendRAMail.btnSend_Click(Object sender, EventArgs e) in XXX:1300 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +107 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3436 Version Information: Microsoft .NET Framework Version:2.0.50727.4216; ASP.NET Version:2.0.50727.4223 

Can anyone suggest me some solution. Since I also have some solutions that tell me to change access permission for Word DLLs using DCOMCNFG , but still getting the same error. But at some point it works correctly ... I think the code is not a problem. As well as how I will find which account is using my current application. (ex.Network Service, Administrator, etc.)

+2
source share
4 answers

I found a solution

using DCOMCNFG.exe, open it and go to Component Service → Computers-> My Computer-> DCOM Configuration-> check the box "Microsoft Office Word" and select the "Security" tab. Then you will get the parameters “Launch and activation permission” → “Configure” and click “Change” and add the user who will run the application with full access.

So that all this helps solve this problem, it will help.

+6
source

My idea is to get rid of Com together if I can find the best solution I would use.

check this

http://docx.codeplex.com/

+1
source

One thing I did on my server was to open Microsoft Word on the computer, and that seemed to make the problem go away.

0
source

You can create another user, then log in with this and create a remote user 121.0.0.1 and the primary user (loopback to rpc !!!), then disconnect from the new user and you will have an interactive user

0
source

Source: https://habr.com/ru/post/1488314/


All Articles