无法加载文件或程序集“***.dll"或其依赖项之一 [英] Could not load file or assembly '***.dll' or one of its dependencies

查看:46
本文介绍了无法加载文件或程序集“***.dll"或其依赖项之一的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个很久以前创建的 dll,用于连接到我为其开发的特定软件的数据库.4 年多来,我使用这个 dll 的应用程序数不胜数.

I have this dll that I created a long time ago and use to connect to the db of a specific software that I develop for. I have had no issues for well over 4 years and countless applications with this dll.

尝试部署我的最新作品时,出现以下错误:

Trying to deploy my latest creation, I get the following error:

System.IO.FileNotFoundException: Could not load file or assembly '***.dll' or one of its dependencies. The specified module could not be found.

因此,对于我写过的每个 dll,我总是制作一个简单的表单应用程序来单独测试该 dll.运行那个简单的应用程序产生了同样的错误.该 dll 不加载或使用除以下内容之外的任何内容:System、System.Data、System.XML.所以就它的依赖而言,我看不出有什么问题.

So, for every dll I ever wrote, I always made a simple forms application to test that dll just by itself. Running that simple app yielded the same error. The dll doesn't load or use anything else than: System, System.Data, System.XML. So as far as depencies of it go, I don't see anything wrong.

顺便说一下,一切都在开发站上运行.问题仅限于部署站..Net 和必要的可再发行组件(因为我使用 C++ 完成所有工作)已部署并运行.

By the way everything works on a dev station. The problem is limited to deployment stations. .Net and the necessary redistributables, since I do everything in C++, are deployed and working.

运行 FUSLOGVW.exe 显示一切正常.

Running FUSLOGVW.exe showed everything as working fine.

运行depends.exe 说:警告:由于延迟加载依赖模块中缺少导出功能,至少有一个模块具有未解析的导入.

Running depends.exe said: Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.

我已经尝试重写整个内容.结果相同.

I already tried rewriting the whole thing. Which yielded the same results.

有人有线索吗?

编辑

以下是错误信息:

See the end of this message for details on invoking "
just-in-time (JIT) debugging instead of this dialog box."

************** Exception Text **************"
System.IO.FileNotFoundException: Could not load file or assembly 'connectionTo.dll' or one of its dependencies. The specified module could not be found."
File name: 'connectionToJobboss32.dll'"
   at TESTConnection.Form1.button1_Click(Object sender, EventArgs e)"
   at System.Windows.Forms.Control.OnClick(EventArgs e)"
   at System.Windows.Forms.Button.OnClick(EventArgs e)"
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)"
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)"
   at System.Windows.Forms.Control.WndProc(Message& m)"
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)"
   at System.Windows.Forms.Button.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.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)"
"



************** Loaded Assemblies **************"
mscorlib"
    Assembly Version: 4.0.0.0"
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)"
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll"
----------------------------------------"
TESTConnection"
    Assembly Version: 1.0.3996.18980"
    Win32 Version: "
    CodeBase: file:///C:/Program%20Files%20(x86)/conn/TESTConnection.exe"
----------------------------------------"
System.Windows.Forms"
    Assembly Version: 4.0.0.0"
    Win32 Version: 4.0.30319.1 built by: RTMRel"
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll"
----------------------------------------"
System.Drawing"
    Assembly Version: 4.0.0.0"
    Win32 Version: 4.0.30319.1 built by: RTMRel"
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll"
----------------------------------------"
System"
    Assembly Version: 4.0.0.0"
    Win32 Version: 4.0.30319.1 built by: RTMRel"
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll"
----------------------------------------"

事件查看器中没有错误.

There is no errors in the event viewer.

推荐答案

或其依赖项之一

这是常见的问题,您看不到带有 Fuslogvw.exe 的非托管 DLL.最好的办法是运行 SysInternals 的 ProcMon 实用程序.您会看到它在搜索 DLL 而没有找到它.Dependency Walker 中的 Profile 模式也可以显示.

That's the usual problem, you cannot see a missing unmanaged DLL with Fuslogvw.exe. Best thing to do is to run SysInternals' ProcMon utility. You'll see it searching for the DLL and not find it. Profile mode in Dependency Walker can show it too.

这篇关于无法加载文件或程序集“***.dll"或其依赖项之一的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆