使用unfreez_wrapper.dll找不到文件异常

时间:2013-10-08 06:31:34

标签: c# winforms

无法加载文件或程序集'unfreez_wrapper.dll'或其依赖项之一。无法找到指定的模块

ei = new ExtractImages(StartTags,LastTags,Maps, localFilename, UrlsPath);

ei是一个使用该文件的新类:unfreez_wrapper.dll 我现在从硬盘上的不同位置添加了两次dll文件的文件。

完整的异常消息:

System.IO.FileNotFoundException was unhandled
  HResult=-2147024770
  Message=Could not load file or assembly 'unfreez_wrapper.dll' or one of its dependencies. The specified module could not be found.
  Source=WeatherMaps
  FileName=unfreez_wrapper.dll
  FusionLog=""
  StackTrace:
       at WeatherMaps.ExtractImages..ctor(List`1 FirstTags, List`1 LastTags, List`1 Maps, String LocalFileDir, String UrlsDir)
       at WeatherMaps.Form1..ctor() in d:\C-Sharp\WeatherMaps\WeatherMaps\WeatherMaps\Form1.cs:line 60
       at WeatherMaps.Program.Main() in d:\C-Sharp\WeatherMaps\WeatherMaps\WeatherMaps\Program.cs:line 19
       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.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 

文件属性:

Aliases: Global
Copy Local: True
Embed Interop: False

其余的我无法改变。 当我将鼠标放在路径上的文件属性时,我看到文件是原始的路径。但由于某种原因,它不会将文件复制到当前项目的Debug目录。

我在这里缺少什么?

2 个答案:

答案 0 :(得分:0)

听起来VS在将文件复制到输出目录时遇到了一些问题。也许你没有足够的特权?如果没有出现任何错误,请查阅构建输出窗口以查看。

但是,您始终可以手动复制所需的.dll。这应该是解决这个问题的最快方法。

答案 1 :(得分:0)

汇编是否在GAC或任何可能覆盖您认为正在加载的程序集的位置?这通常是incorrect assembly being loaded

的结果

||

如果您有一个项目引用另一个项目(例如“引用”类库“的”Windows应用程序“类型)并且两者具有相同的程序集名称,则会出现此错误。您可以强烈命名引用的项目,或者(甚至更好)重命名引用项目的程序集(在VS中项目属性的“应用程序”选项卡下)。

相关问题