c# - System.IO.FileNotFoundException: '无法加载文件或程序集
问题描述
我是 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).
解决方案
错误说
System.IO.FileNotFoundException:'无法加载文件或程序集'Interop.TrueConf_CallXLib,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null'或其依赖项之一。该系统找不到指定的文件。'
所以我怀疑必须有更多的dll依赖于当前的dll。因此,如果 SDK 将库安装到 GAC,请先安装 TrueConf SDK 并从程序集中引用它,而不是使用浏览选项添加 dll。
推荐阅读
- c# - 交换数组的两个特定成员的正确方法是什么?
- python - 我正在安装 turicreate 并出现错误
- python - 如何在 Python tkinter 中创建子模态窗口?
- visual-studio-code - 在边缘模拟器中运行的 Azure Edge 模块的 vscode 调试配置?
- node.js - Deno 和 Rust 一样快吗?
- javascript - 在表单末尾按下制表符时是否可以捕获制表键?
- python - 将更新的矩阵附加到列表时如何避免覆盖?
- git - 如何在不提交任何提交的情况下恢复通过命令 git clean -xdf 删除的 git 文件
- python - Python 3.7.7 中的错误模块 Datawig 0.1.12:OSError: [WinError 126] 找不到指定的模块
- google-apps-script - 表格将时间错误地导出到日历事件描述 1899 年 12 月