I am trying to use a couple of libraries in my asp.net website that I pulled in using NuGet.
Problem is I am getting this error:
Could not load file or assembly 'AWSSDK, Version=1.5.9.1, Culture=neutral, PublicKeyToken=cd2d24cd2bace800' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
One of the libraries I am trying to use needs to use the AWSSDK but apparently it is looking for an older version I can no longer get.
Is it possible to ignore this error?
This is a brand new website with no code in it yet, just what has been pulled in by NuGet, the web.config is empty.
EDIT:
I added Fusion logging and now I get:
=== Pre-bind state information === LOG: User = WIN-FSSH1EIG4NEMax LOG: DisplayName = AWSSDK, Version=1.5.9.1, Culture=neutral, PublicKeyToken=cd2d24cd2bace800 (Fully-specified) LOG: Appbase = file:///C:/Users/Max/Documents/Visual Studio 2010/WebSites/images.RepZio/ LOG: Initial PrivatePath = C:UsersMaxDocumentsVisual Studio 2010WebSitesimages.RepZiobin Calling assembly : ImageResizer.Plugins.S3Reader, Version=3.3.2.447, Culture=neutral, PublicKeyToken=null. === LOG: This bind starts in default load context. LOG: Using application configuration file: C:UsersMaxDocumentsVisual Studio 2010WebSitesimagesweb.config LOG: Using machine configuration file from C:WindowsMicrosoft.NETFrameworkv2.0.50727configmachine.config. LOG: Post-policy reference: AWSSDK, Version=1.5.9.1, Culture=neutral, PublicKeyToken=cd2d24cd2bace800 LOG: Attempting download of new URL file:///C:/Users/Max/AppData/Local/Temp/Temporary ASP.NET Files/root/8dcd52e9/53da58e/AWSSDK.DLL. LOG: Attempting download of new URL file:///C:/Users/Max/AppData/Local/Temp/Temporary ASP.NET Files/root/8dcd52e9/53da58e/AWSSDK/AWSSDK.DLL. LOG: Attempting download of new URL file:///C:/Users/Max/Documents/Visual Studio 2010/WebSites/images/bin/AWSSDK.DLL. WRN: Comparing the assembly name resulted in the mismatch: Revision Number ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
I get the same error if I add a bindingRedirect as mentioned in the comment below.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
The latest (1.5.13.0) AWSSDK release seems to have been signed with a different key than the previous releases. So unfortunately a bindingRedirect won’t work.
Proceed as follows:
Open the package manager console (Tools > Library Package Manager > Package Manager Console) and type:
PM> Uninstall-Package -Force AWSSDK
followed by:
PM> Install-Package AWSSDK -Version 1.5.12.1
Then double check your web.config file. Make sure that it only contains the following binding redirect for AWSSDK:
<dependentAssembly>
<assemblyIdentity name="AWSSDK" publicKeyToken="cd2d24cd2bace800" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.5.12.1" newVersion="1.5.12.1" />
</dependentAssembly>
Now, your project should be good to go.
Method 2
Try to edit .csproj file and remove the Version=1.5.9.1 from line where the assembly awssdk is referenced.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0