【问题标题】:Strange System.Runtime.InteropServices.COMException error奇怪的 System.Runtime.InteropServices.COMException 错误
【发布时间】:2012-07-05 14:51:22
【问题描述】:

我在我的服务器上发布并安装了一个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”文件,但我不知道是哪一个,或者这是否是真正的问题。什么可能导致这种情况?我该如何解决?

【问题讨论】:

标签: c# winforms dll error-handling publish


【解决方案1】:

这是 COM 互操作的问题。您需要手动将dll文件复制到应用程序或将dll文件打包到安装程序中。

【讨论】:

  • 好吧,与其手动复制,不如重新安装Microsoft Image Acquisition Library更安全地解决问题。感谢您现在解决的想法。
猜你喜欢
  • 2013-03-07
  • 2010-11-17
  • 1970-01-01
  • 2014-10-11
  • 2012-04-27
  • 2013-10-30
  • 2016-09-18
  • 2012-03-18
  • 2015-05-13
相关资源
最近更新 更多