Could not load file or assembly ‘DotNetOpenAuth.Core, Version=4.0.0.0,

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 ‘DotNetOpenAuth.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Happens because of latest dotnetopenauth version mismatch .  Usually this happens for people who creates mvc 4 project and updates DotNetOpenAuth assemblies thru nuget.  so just add the following to your web.config.

Here is the solution:

<runtime>

...……………add the following…….

<dependentAssembly>
<assemblyIdentity name=”DotNetOpenAuth.AspNet” publicKeyToken=”2780ccd10d57b246″ culture=”neutral” />
<bindingRedirect oldVersion=”0.0.0.0-4.2.0.0″ newVersion=”4.2.0.0″ />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name=”DotNetOpenAuth.Core” publicKeyToken=”2780ccd10d57b246″ culture=”neutral” />
<bindingRedirect oldVersion=”0.0.0.0-4.2.0.0″ newVersion=”4.2.0.0″ />
</dependentAssembly>

</runtime>