【发布时间】:2019-04-03 13:14:42
【问题描述】:
我是 C# 初学者,尝试在项目中添加一个 DLL,但在运行项目时出现以下错误:
System.IO.FileNotFoundException: 'Could not load file or assembly 'Interop.TrueConf_CallXLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.'
我尝试在任何 CPU、X64 和 x86 上运行它,但它几乎是相同的错误。 你能帮我修一下吗?
以下是完整的例外:
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Interop.TrueConf_CallXLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
at AxTrueConf_CallXLib.AxTrueConfCallX.AttachInterfaces()
at System.Windows.Forms.AxHost.GetOcxCreate()
at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
at System.Windows.Forms.AxHost.CreateHandle()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
The program '[20208] TruconfCall.exe' has exited with code 0 (0x0).
【问题讨论】:
-
您是否尝试右键单击引用 -> 添加引用 -> 浏览 dll?
-
它希望您导入的 DLL 在发布或调试/发布文件夹中。
-
“系统找不到指定的文件。”,您是否检查了该文件是否仍然存在于给定位置?
-
@NasriYatim 是的,我通过这种方式添加了参考。
-
@Innominatum 是的,该文件确实存在。