We are extensively using COM Interop with MSOffice applications, and one of them - MSProject 2013, is behaving very unstable and strange.
Sometimes it starts just fine, and works fine, but from time to time it is bugging us with following error:
Retrieving the COM class factory for component with CLSID
{36D27C48-A1E8-11D3-BA55-00C04F72F325} failed due to the following
error: 80080005 Server execution failed (Exception from HRESULT:
0x80080005 (CO_E_SERVER_EXEC_FAILURE)).
This can happen at any time, does not matter if windows was rebooted a few seconds ago, or uptime is several hours and MSProject was opened and closed several times.
What can we do to solve, or at least diagnose root cause of such a behavior?
this is a generic the best answer
Using DCOMCNFG.exe. Open it and go to: Component Services -> Computers -> My Computer -> DCOM Config -> Microsoft Excel Application.
Open the properties, select Identity tab and select the interactive user.
come from this link Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE))
but the actual error caused a memory issue which leaded to the exception from hresult 0x80080005 error.
check if maybe open file and didn't close it after reading msProject check the behavior of the code.
Also i recommend to change COM and read MsProject from XML to be faster and more clear than interop
Related
The problem
We have a native application, that integrates with Outlook through COM/interop.
Intermittently we experience different errors relating to COM, MAPI, Redemption and the Windows Registry. And this is only at a single client installation.
It works 95-99% of the time. This percentage is extrapolated from looking at our log files.
We have quite a few other client installations, that never get the errors with the same version (same code) of the native application. We only experience the errors at this one client installation.
That leads me to believe the problem is likely to stem from something different at the client installation and not the code. But this is of course only a hypothesis.
Errors
Error one
Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)
When calling:
var outlookApp = (Application) Marshal.GetActiveObject("Outlook.Application");
var mapiObject = outlookApp.GetNamespace("MAPI").MAPIOBJECT; // <-- This line causes the error
at Microsoft.Office.Interop.Outlook.ApplicationClass.GetNamespace(String Type)
Error two
Interface not registered (Exception from HRESULT: 0x80040155)
When calling:
Microsoft.Office.Interop.Outlook._MailItem.get_Attachments()
Error three
Error in MAPILogonEx: MAPI_E_LOGON_FAILED
When calling:
Redemption.IRDOSession.Logon(Object ProfileName, Object Password, Object ShowDialog, Object NewSession, Object ParentWindowHandle, Object NoMail)
Tried so far
Reinstalling the entire machine from scratch
Reinstalling Office
Repairing Office
Checked the registry to see if multiple version of Office are present
There is only one version - "9.6" (Microsoft Office Standard 2019)
Run regsvr32 on the Redemption dll
Info:
Skype/Skype for business is not installed
Exchange Online is used, not om premise
Windows, Outlook and our native application are all x64
The strange thing is that is works most of the time. If it was a problem with the registration (registry), i would expect it to fail every time.
It looks like it might be a MAPI problem, but again it works most of the time.
I have been researching the problem for a few days now and haven't been able to find out why the problems are occurring intermittently. I have found a lot of information on the different errors, but they all seem to occur consistently; the errors occur every time the code is called in the error scenarios i have found.
Has anyone experienced anything similar or know why it might be happening?
Your machine is corrupted or any malware is presented. The problem is not related to the Redemption library because even the Outlook object model gives errors related to windows registry keys required for the COM interoperability.
TYPE_E_LIBNOTREGISTERED and REGDB_E_IIDNOTREG errors are a pretty strong indication that some COM registry keys are missing. Try to completely uninstall and then reinstall Outlook (not just Repair).
I am trying to integrate to ZKTeco bio-metric device with my web application. It's working absolutely fine but when I deploy application and try to connect with bio-metric device I get the following error:
Retrieving the COM class factory for component with CLSID {00853A19-BD51-419B-9269-2DABE57EB61F} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
I am following this tutorial.
I tried following solutions:
I changed the reference of my dll to copy to local.
I changed the targeted CPU before deploying.
But both the solutions didn't work. What could be possible solution?
You must register zkemkeeper in every computer that will use your program, not just in the development environment.
To register the zkemkeeper dll in both development and deployment computers, follow the steps provided in the solution of this post: Error when inserting finger print data into database table. When registering in deployment computers, avoid the steps related with the Visual Studio.
You should also take a look to this document, it provides useful information to understand how zkemkeeper works: COM Class Objects and CLSIDs.
Best regards.
In my WPF application I am using Microsoft.Office.Interop.Excel to import data from excel file. I have been using this code for last couple of months and it has been working just fine for me. Today all of a sudden when I ran the utility I got the following error.
Unable to cast COM object of type
'Microsoft.Office.Interop.Excel.ApplicationClass' to interface type
'Microsoft.Office.Interop.Excel._Application'. This operation failed
because the QueryInterface call on the COM component for the interface
with IID '{000208D5-0000-0000-C000-000000000046}' failed due to the
following error: Library not registered. (Exception from HRESULT:
0x8002801D (TYPE_E_LIBNOTREGISTERED)).
I had originally Office 2013 installed but 2 months ago I uninstalled and installed the 2007 version. Everything was working fine until now.
I have read on different posts to delete the registry entry corresponding to the above IID. I have tried doing that but no help. I uninstalled/repaired Office as well but no help.
I have tried to register the Microsoft.Office.interop.excel.dll using regasm.exe as well but again no luck. Whats the issue here?
I had a some problems with Interop. then I switched to Microsoft.Jet.OLEDB.4.0 don't know if it helps, but I found it to be much more stable.
I got the exception mentioned in the title, and its inner exception contains this text:
Retrieving the COM class factory for component
with CLSID {609E6B75-5664-11D4-958C-080009D5C296}
failed due to the following error: 800401f9.
This problem occurrs on my 64 bit computer (Win 7), after I moved an entire solution (with 3 projects) from another machine (also 64 bit, Win Server 2008).
There was no problem on the source machine when the building was in progress (the target platform is Any CPU in both cases). The solution was built properly. But on my computer it throws an exception when I start the program.
The project refers to 6 DLLs (written in .NET, but I don't know them well).
I didn't find the mentioned CLSID under HKEY_CLASSES_ROOT\CLSID on my computer, but those are there on the source computer (but I don't know how they got there...). I kind of stuck. I would appreciate any suggestion, advice how to get through this. Thank you.
my .net web application has a option of uploading a excel file, which has around 1k entries of products, the upload works fine when i run the application on localhost, but results in the following error when it is hosted on iis7 & accessed by some other computer on the network..
error
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)).
Exception Details: System.UnauthorizedAccessException: 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)).
I googld it, and found some talking about 32-bit or 64-bit OS.
Thanks.
You should avoid using Excel Interop in a server application for the reasons described in this KB article.
Instead, consider using a third-party product to manipulate the Excel document, such as EPPlus (Excel 2007+), Aspose Cells, SpreadsheetGear.
Probably your ASP.NET app is running under an account that doesn't have a profile.
Ensure the upload folder is given full permission so as to upload from other computers. First start by giving permission to EVERYONE. Then you may restrict it to IIS user only.
Sounds to me that when your implementing your application on the server, something isn't getting installed that your using on your development machine. Whatever your using to upload, if it is a third party upload control or something, you might not be distributing that file.
Another possibility is, that the server your installing your application on is a 64 bit machine, and the upload control your using is built for 32 bit only. You might want to set the server to 32 bit for IIS 7.
http://www.depotsystems.com/ds_mobile_webhelp/webhelp/index.htm#page=Enabling_32_bit_mode.htm