System.IO.FileNotFoundException:'无法加载文件或程序集

时间:2019-04-03 13:14:43

标签: c# .net dll

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

1 个答案:

答案 0 :(得分:0)

错误提示

System.IO.FileNotFoundException:'无法加载文件或程序集'Interop.TrueConf_CallXLib,版本= 1.0.0.0,区域性=中性,PublicKeyToken =空'或其依赖项之一。系统找不到指定的文件。'

因此,我怀疑当前的dll依赖于其他dll。因此,不要使用浏览选项添加dll,而是先安装TrueConf SDK,如果SDK将库安装到GAC,则从程序集引用它。

相关问题