当dll运行到另一台PC时,用户代码异常无法处理Filenotfoundexception [英] Filenotfoundexception was unhandled by user code exception occur when dll run into another pc

查看:61
本文介绍了当dll运行到另一台PC时,用户代码异常无法处理Filenotfoundexception的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个使用sql连接等代码的公司dll。

现在这些dll在另一台PC上使用然后异常创建



异常是: - 无法加载文件或程序集dll.name,version = 1.0.0.0,culture = neutrl,PublicKeyToken = null或其依赖项之一。系统找不到指定的文件



请有人提供最佳解决方案......

谢谢



我尝试了什么:



实际上我不明白这是什么错误以及如何解决..

所以请帮助我任何人....

I create a company dll which is used sql connection or etc. code.
now these dll use in another pc then exception create

exception is :- "Could not load file or assembly dll.name, version=1.0.0.0",culture=neutrl,PublicKeyToken=null or one of its dependencies. The system cannot find the file specfied"

please anybody can provide best solutions...
thanks

What I have tried:

Actually i don't understand what is this error and how to resolved..
so please help me anybody....

推荐答案

如果公司DLL没有安装到第二台PC上的GAC (或者GAC中的版本不同)然后DLL文件需要与可执行文件位于同一目录中才能正确加载 - 这同样适用于该程序集引用的所有支持DLL。

错误是说它无法找到要加载的正确程序集,因此应用程序无法运行。
If the company DLL is not installed into the GAC on the second PC (or the version in the GAC is different) then the DLL file needs to be in the same directory as the executable in order to load correctly - and the same applies to all the supporting DLL's that that assembly references.
The error is saying that it can't find the right assembly to load and so the application can't run.


这篇关于当dll运行到另一台PC时,用户代码异常无法处理Filenotfoundexception的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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