C# – Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)

64-bitccomwindows

I'm creating a windows service on a windows 2003 machine, using dsofile to modify custom properties on a bunch of documents. This works fine until I install the service on a win2k8 machine where it gives me the following error:

ERROR [2010-09-06 13:17:12,317] An
unknown error occured:
System.InvalidCastException: Unable to
cast COM object of type
'DSOFile.OleDocumentPropertiesClass'
to interface type
'DSOFile._OleDocumentProperties'. This
operation failed because the
QueryInterface call on the COM
component for the interface with IID
'{58968145-CF01-4341-995F-2EE093F6ABA3}'
failed due to the following error:
Error loading type library/DLL.
(Exception from HRESULT: 0x80029C4A
(TYPE_E_CANTLOADLIBRARY)).

All my projects are set to run as x86, and Ive used procmon to monitor the files requested without any clues.. Anyone have any ideas on how to solve this?

Best Answer

Since you have mentioned that you are running a service under Win2008,

  • The first clue is, is the DSO File dll component part of Office, what version? is that installed?
  • I am not sure if a service can access such a office component running as a system account user which could be open to malicious exploits whilst running under said account as a service...
  • TYPE_E_CANTLOADLIBRARY should be as a result of the first option given...
Related Topic