简体   繁体   English

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

[英]System.IO.FileNotFoundException: 'Could not load file or assembly

I am beginner in C# and trying to add one DLL in project but getting the below error when running the project:我是 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.'

I have tried to run it on Any CPU, X64 and x86 but its almost the same error.我试图在任何 CPU、X64 和 x86 上运行它,但它几乎是相同的错误。 Can you please help me fix it?你能帮我修一下吗?

Below is the full exception:以下是完整的例外:

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

The error says错误说

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 . System.IO.FileNotFoundException: '无法加载文件或程序集 'Interop.TrueConf_CallXLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'或其依赖项之一 The system cannot find the file specified.'该系统找不到指定的文件。'

So I suspect there must be some more dlls on which current dll is depends.所以我怀疑必须有更多的 dll 依赖于当前的 dll。 So instead of adding dll using browse option, first install TrueConf SDK and reference it from assembly if SDK install libraries to GAC.因此,不要使用浏览选项添加 dll,首先安装 TrueConf SDK 并从程序集引用它,如果 SDK 将库安装到 GAC。

Any CPU任何 CPU

You just opened a huge can of worms, because Any CPU is a.Net concept, it doesn't map to more native processes, and indeed the CPU itself doesn't support it.您刚刚打开了一大堆蠕虫,因为Any CPU是一个.Net概念,它不会map到更多的本机进程,而且CPU本身也不支持它。 And since COM uses native libraries to work, you really have to pick one architecture on both client and server, and stick with it.由于 COM 使用本机库来工作,因此您确实必须在客户端和服务器上选择一种架构并坚持下去。

Now that out of the way, you say that the dll exists on disk, but it won't load with the exception above, so short of you doing anything wonky like deleting the file from the output binary folder, or doing something to prevent the file from being copied, the biggest problem I can think of is that you're missing one of the libraries' dependencies, perhaps the correct C++ runtime (both version and architecture?) ?既然不碍事,你说 dll 存在于磁盘上,但它不会加载上述异常,所以没有你做任何奇怪的事情,比如从 output 二进制文件夹中删除文件,或者做一些事情来防止文件被复制,我能想到的最大问题是您缺少库的依赖项之一,也许是正确的 C++ 运行时(版本和架构?)?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法加载文件或程序集System.IO.FileNotFoundException - Could not load file or assembly System.IO.FileNotFoundException System.IO.FileNotFoundException:无法加载文件或程序集 - System.IO.FileNotFoundException: Could not load file or assembly 奇怪的错误:System.IO.FileNotFoundException:无法加载文件或程序集 - Weird Error: System.IO.FileNotFoundException: Could not load file or assembly System.IO.FileNotFoundException: 无法加载文件或程序集 C# - System.IO.FileNotFoundException: Could not load file or assembly C# 无法加载程序集>> System.IO.FileNotFoundException:无法加载文件或程序集'System.Core, - Unable to Load assembly>>System.IO.FileNotFoundException: Could not load file or assembly 'System.Core, System.IO.FileNotFoundException:无法加载文件或程序集“程序集名称”或其依赖项之一 - System.IO.FileNotFoundException: Could not load file or assembly 'name of assembly' or one of its dependencies 发布版本抛出“ System.IO.FileNotFoundException:无法加载文件或程序集”以查找XmlSerializers程序集 - Release build throws “System.IO.FileNotFoundException: Could not load file or assembly” looking for XmlSerializers assembly System.IO.FileNotFoundException:无法加载文件或程序集。 系统找不到文件SharpSvn.dll - System.IO.FileNotFoundException: Could not load file or assembly. The system cannot find the file SharpSvn.dll System.IO.FileNotFoundException:无法加载文件或程序集System.Xml.Linq - System.IO.FileNotFoundException: Could not load file or assembly System.Xml.Linq System.IO.FileNotFoundException:无法加载文件或程序集'System.Web.DataVisualization MEF MVC - System.IO.FileNotFoundException: Could not load file or assembly 'System.Web.DataVisualization MEF MVC
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM