2010-09-06 318 views
0

我在Windows 2003機器上創建一個Windows服務,使用dsofile修改一堆文件的自定義屬性。異常來自HRESULT:0x80029C4A(TYPE_E_CANTLOADLIBRARY)

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)).

我的所有項目都設定爲x86的運行,並且Ive使用將procmon監測沒有任何線索,要求文件:直到我一個win2k8的機器上安裝的服務,而它給我下面的錯誤這工作得很好。任何人對如何解決這個問題有任何想法?

回答

1

既然你提到,你正在運行的Win2008下的服務,

  • 第一條線索是,是辦公室的DSO文件DLL組件一部分,是什麼版本?是安裝的?
  • 我不知道,如果一個服務可以訪問這樣的辦公組件中運行的系統帳戶的用戶可能是開放給惡意攻擊,同時表示帳戶下運行作爲一項服務...
  • TYPE_E_CANTLOADLIBRARY應儘可能的結果第一個選項給出...
+0

我覺得dsofile是一個獨立的DLL和實際上並不需要的辦公室才能工作。無論如何,我有辦公室(2007)安裝,所以沒有問題。 – femseks 2010-09-06 11:54:13

+0

我現在使用regsvr32在gac中註冊dsofile.dll,並且似乎解決了這個問題。謝謝你的時間。 – femseks 2010-09-06 11:55:36

0

我有一個類似的問題,我解決了它,由於Geoff Darst - MSFT的解釋。 我調整了原來的答案,以適應你的接口IID:

Sounds like you have a problem with your typelib registration. Presumably, the Com interop layer is hitting the registry to try to locate the typelib. It would start by looking under HKCR\Interface{58968145-CF01-4341-995F-2EE093F6ABA3}\Typelib. The default value should refer to the guid for the typelib that defines the interface in question: which should be located under the following key: HKCR\Typelib{what found in the aforementioned Interface key}. There should be a version subkey and then a 0 subkey, and a win32 subkey under that. The default value of the win32 key should point to the right typelib.

相關問題