我刚从库中生成了一个32位的dll,并尝试在C#(debug-x86)中使用基于Windows的表单应用程序。我添加了dll文件作为参考,现在当我运行代码时,我得到以下错误
System.IO.FileNotFoundException was unhandled
Message=Could not load file or assembly 'org.apache.qpid.messaging.dll' or one of its dependencies. The specified module could not be found.
Source=QpidRx_CSharp
FileName=org.apache.qpid.messaging.dll
FusionLog=""
StackTrace:
at QpidRx_CSharp.Program.Main()
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
关于如何解决此问题的任何建议?
答案 0 :(得分:1)
使用(免费和优秀的)'DependencyWalker'查看dll以查看缺少的内容(因为错误似乎表明这里确切存在问题:您没有完成所有必需的依赖项。)
答案 1 :(得分:1)
对于正在使用DLL的项目的DLL引用,Copy Local
值是否设置为True? (右键单击VS中解决方案资源管理器中的引用,然后选择属性)。如果没有,那么DLL将不会在应用程序的Bin \ Debug文件夹中,并且将无法找到它。
另一种可能性是你的DLL本身具有无法找到的依赖项。您的DLL是否引用除.Net框架程序集以外的任何内容?