gpt4 book ai didi

c# - 奇怪的System.Runtime.InteropServices.COMException错误

转载 作者:行者123 更新时间:2023-12-03 08:35:17 25 4
gpt4 key购买 nike

我有一个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文件打包到安装程序中。

关于c# - 奇怪的System.Runtime.InteropServices.COMException错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11340289/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com