【发布时间】:2014-05-07 13:07:38
【问题描述】:
我想在我的 C# 项目中使用 Pcap.Net。我下载并添加了对项目的 .dll 引用。
项目构建成功,但是当我运行它时,出现以下异常。
System.IO.FileNotFoundException was unhandled
Message=Could not load file or assembly 'PcapDotNet.Core.dll' or one of its dependencies. The specified module could not be found.
Source=trafcon
FileName=PcapDotNet.Core.dll
FusionLog=""
StackTrace:
at ObtainingTheDeviceList.Program.Main(String[] args)
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:
我该怎么办?
【问题讨论】:
-
你能检查一下 PcapDotNet.Core.dll 是否被复制到 bin Debug/Release 目录吗?
-
您是在将项目标记为 x86 还是 x64?您使用的是正确的 x86/x64 dll 吗?
-
你安装Winpcap了吗?