The following error:
Exception Details: System.IO.FileLoadException: Could not load file or assembly…
is very common, and can occur for a large number of reasons. This is one of several blog posts where we’ve performed controlled experiments to see what error results from an intentional mistake.
Case #2: Intentionally put wrong version of ChilkatDotNet2.dll in the app’s bin directory.
This is the error:
Server Error in '/' Application.
Could not load file or assembly 'ChilkatDotNet2, Version=8.2.2.0, Culture=neutral,
PublicKeyToken=eb5fc1fc52ef09bd' or one of its dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)
Description: An unhandled exception occurred during the execution of the current web request.
Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileLoadException: Could not load file or assembly 'ChilkatDotNet2, Version=8.2.2.0,
Culture=neutral, PublicKeyToken=eb5fc1fc52ef09bd' or one of its dependencies. The located assembly's
manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the
origin and location of the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'ChilkatDotNet2,
Version=8.2.2.0, Culture=neutral, PublicKeyToken=eb5fc1fc52ef09bd' could not be loaded.
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]
(DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
Stack Trace:
[FileLoadException: Could not load file or assembly 'ChilkatDotNet2, Version=8.2.2.0, Culture=neutral,
PublicKeyToken=eb5fc1fc52ef09bd' or one of its dependencies. The located assembly's manifest definition
does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
_Default.Button1_Click(Object sender, EventArgs e) +0
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
+7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean
includeStagesAfterAsyncPoint) +5102
Version Information: Microsoft .NET Framework Version:2.0.50727.312; ASP.NET Version:2.0.50727.833