Dapper以.NET 4.6失败 - 无法加载文件或组装



我有一个wpf/mvvm灯应用程序针对.net 4.6和dapper 1.50.4我正在使用Visual Studio Pro 2017来开发应用程序

此应用程序正在工作,但是我得到了一台新计算机,并将此应用程序的开发转移到了新计算机上。当我尝试在新计算机上运行此应用程序时,我会收到以下错误:

system.io.io.fileleloadexception:'无法加载文件或汇编'dapper, 版本= 1.50.4.0,文化=中性,publicKeyToken = null'或其中之一 依赖性。需要一个强有力的组件。(来自 Hresult:0x80131044('

我尝试过的

  1. 我可以确认dapper.dll在projectRoot/bin/debug目录中
  2. 我已经运行汇编绑定日志查看器,并且在运行应用程序时只会遇到一个错误,但是它不在dapper.dll上,它在system.windows.dll上:
The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.
Assembly manager loaded from:  C:WindowsMicrosoft.NETFramework64v4.0.30319clr.dll
Running under executable  C:Usersjorda...binDebugFTC_Application.exe
--- A detailed error log follows. 
=== Pre-bind state information ===
LOG: DisplayName = System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
 (Fully-specified)
LOG: Appbase = file:///C:/Users/jorda/.../bin/Debug/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = FTC_Application.exe
Calling assembly : GalaSoft.MvvmLight, Version=5.3.0.19026, Culture=neutral, PublicKeyToken=e7570ab207bcb616.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:Usersjorda...binDebugFTC_Application.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:WindowsMicrosoft.NETFramework64v4.0.30319configmachine.config.
LOG: Post-policy reference: System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Users/jorda/.../bin/Debug/System.Windows.DLL.
LOG: Attempting download of new URL file:///C:/Users/jorda/.../bin/Debug/System.Windows/System.Windows.DLL.
LOG: Attempting download of new URL file:///C:/Users/jorda/.../bin/Debug/System.Windows.EXE.
LOG: Attempting download of new URL file:///C:/Users/jorda/.../bin/Debug/System.Windows/System.Windows.EXE.
LOG: All probing URLs attempted and failed.
  1. 我已经卸载并重新安装了Dapper的Nuget软件包
  2. 清除了我项目中的OBJ文件夹以强制重建
  3. 该应用程序存在于一个驱动器文件夹中,因此我禁用一个驱动器,认为同步过程可能一直在锁定文件,但这并没有解决问题。
  4. 显然重新启动视觉工作室
  5. 更新到最新版本的MVVM Light-无更改

某些东西显然与将此解决方案移至另一台计算机有关,但我不确定在哪里跟踪。

问题

有人可以帮助我弄清楚为什么在我的项目中调用Dapper时会遇到此错误,或帮助我修复它?

预先感谢

,所以我没有意识到有一个强烈的命名和非命名版本的Dapper版本。事实是,我对签名的集会并不了解很多。

解决方案:

  1. 删除普通的Dapper Nuget软件包
  2. 安装dapper.strongname nuget软件包。

请参阅此问题(信用(

最新更新