I have a WPF / MVVM Light application targeting .net 4.6 and Dapper 1.50.4 I am using Visual Studio Pro 2017 to develop the application
This application was working, but I got a new computer and moved the development of this application to the new computer. When I try to run this application on my new computer I get the following error:
System.IO.FileLoadException: 'Could not load file or assembly 'Dapper, Version=1.50.4.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)'
What I have tried
- I can confirm that the dapper.dll is in the projectRoot/bin/debug directory
- I have run the Assembly Binding Log Viewer and I only get one error when running my application, but it is not on the dapper.dll, it is on the system.windows.dll:
The operation failed. Bind result: hr = 0x80070002. The system cannot find the file specified. Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll Running under executable C:\Users\jorda\...\bin\Debug\FTC_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:\Users\jorda\...\bin\Debug\FTC_Application.exe.Config LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.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.
- I have uninstalled and reinstalled the NuGet package for dapper
- cleared out the obj folder in my project to force a rebuild
- the application exists in a one drive folder, so I disabled one drive thinking that the sync process might have been locking the files, but this did not fix the problem.
- obviously restarted Visual Studio repeatedly
- Updating to latest version of MVVM light - no change
Something is clearly related to moving this solution to another computer, but I am not sure where to track it down.
QUESTION
Can someone help me figure out why I am getting this error when calling dapper in my project, or help me fix it?
thanks in advance