C#应用程序找不到.dll引用文件,而两者都在同一个文件夹中 [英] C# application cannot find .dll reference file while both are in the same folder

查看:906
本文介绍了C#应用程序找不到.dll引用文件,而两者都在同一个文件夹中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在winform c#项目中添加了一个.dll文件作为参考。



输出是一个.exe文件和一个.dll文件。 />


当我在bin / debug文件夹中运行.exe文件或我自己的计算机上的任何其他文件夹时,它运行良好。



为了在其他计算机上运行.exe文件,我只需将.exe文件和.dll文件复制到一个文件夹中..



I感到困惑,它在某些电脑上运行,但它弹出停止在其他人的工作错误:



I have add a .dll file as a reference in my winform c# project.

The output is one .exe file and one .dll file.

It works well when I run the .exe file in bin/debug folder .. or any other folder on my own computer.

For running the .exe file in other computers, I simply copy both .exe file and the .dll file in a folder..

I got confused that it works in some computers, but it pops up stop working error in others :

Problem signature:
   Problem Event Name:                        CLR20r3
   Problem Signature 01:                       programname.exe
   Problem Signature 02:                       0.0.0.0
   Problem Signature 03:                       4e20a786
   Problem Signature 04:                       mscorlib
   Problem Signature 05:                       2.0.0.0
   Problem Signature 06:                       4d8c1599
   Problem Signature 07:                       f9b
   Problem Signature 08:                       80
   Problem Signature 09:                       System.IO.FileNotFoundException
   OS Version:                                          6.1.7600.2.0.0.16.7
   Locale ID:                                             1033





使用异常控制后,我得到了此错误详细信息:





After using exception control, I got this error details:

System.IO.FileNotFoundException: Could not load file or assembly 'dllname.dll' or one of its dependencies. The specific modulo could not be found.





有什么问题!两个文件(.exe和.dll)都在同一个文件夹中!它适用于某些PC!



请注意,所有计算机上都安装了所需的.Net Framework。具有相同的版本。



请注意,我使用的是x86构建体系结构,x86和x64系统的问题相同。



注意有一次我安装了MS Visual Studio 2012,之后错误消息消失了,之后程序正常运行!!我不知道安装VS 2012和问题之间的关系是什么!



请注意,该程序也适用于没有安装VS的电脑!



提前感谢任何帮助。



What's the problem! both files(.exe and .dll) are in the same folder ! It works on some PCs !

Note that required .Net Framework is installed on all computers. with the same versions.

Note that I use x86 build architecture and the problem is the same on both x86 and x64 systems.

Note that one time I've installed MS Visual Studio 2012 and after that the error message disappeared and the program worked correctly after that !! I don't know what could be the relation between installing VS 2012 and the problem !

Note that the program also works well in PCs with no VS installed !

Thanks any help in advance.

推荐答案

错误消息显示无法加载文件或程序集'dllname.dll'或其中一个依赖项

尝试运行其中一个系统上的DLL上的依赖性沃克 [ ^ ]它没有运行。



Soren Madsen
The error message says "Could not load file or assembly 'dllname.dll' or one of its dependencies."
Try running Dependency Walker[^] on your DLL on one of the systems where it does not run.

Soren Madsen


这篇关于C#应用程序找不到.dll引用文件,而两者都在同一个文件夹中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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