簡體   English   中英

奇怪的System.Runtime.InteropServices.COMException錯誤

[英]Strange System.Runtime.InteropServices.COMException error

我有一個Windows Forms應用程序,該應用程序已發布並安裝在服務器上,但是當我嘗試使用它時,不幸的是出現了以下錯誤:

************** Exception Text **************
System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {40942A6C-1520-4132-BDF8-BDC1F71F547B} failed due to the following error:
80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
    at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
    at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
    at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
    at System.Activator.CreateInstance(Type type, Boolean nonPublic)
    at System.Activator.CreateInstance(Type type)
    at PDFtoDoc.Form1.DoOCR(String FullPath)
    at PDFtoDoc.Form1.CheckFileAndDoOCR(String directoryPath)
    at PDFtoDoc.Form1.timer1_Tick(Object sender, EventArgs e)
    at System.Windows.Forms.Timer.OnTick(EventArgs e)
    at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

這似乎是我缺少的一個“ .dll”文件,但我無法弄清楚哪個是真正的問題。 是什么原因造成的? 我該如何解決呢?

這是COM Interop的問題。 您需要手動將dll文件復制到應用程序中,或將dll文件打包到安裝程序中。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM