For some reason when I try to post to one of the ActionMethods on the AccountController
in my MVC4 application, it tells me that it failed to load System.Web.Mvc, Version=1.0.0.0
or one of its dependency. I'm not sure why it is trying to load this assembly when I'm actually using runtime version 4.
I suspected that one of the referenced assemblies could be causing this problem but I'm not really sure. My main suspect is DotNetOpenAuth.Core
because of the following trace:
=== Pre-bind state information === LOG: User = NT AUTHORITY\NETWORK SERVICE LOG: DisplayName = System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 (Fully-specified) LOG: Appbase = file:///C:/tfs/AMS/Main/AMS/AuthServer/ LOG: Initial PrivatePath = C:\tfs\AMS\Main\AMS\AuthServer\bin Calling assembly : DotNetOpenAuth.Core, Version=4.2.0.0, Culture=neutral, PublicKeyToken=2780ccd10d57b246. === LOG: This bind starts in default load context. LOG: Using application configuration file: C:\tfs\AMS\Main\AMS\AuthServer\web.config LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config. LOG: Post-policy reference: System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/d0b0b808/59620299/System.Web.Mvc.DLL. LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/root/d0b0b808/59620299/System.Web.Mvc/System.Web.Mvc.DLL. LOG: Attempting download of new URL file:///C:/tfs/AMS/Main/AMS/AuthServer/bin/System.Web.Mvc.DLL. WRN: Comparing the assembly name resulted in the mismatch: Major Version ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
The exception occurs when I try to post to the following method:
[HttpPost]
public ActionResult Login(String username, String password)
{
var request = Session[SESSION_KEY] as EndUserAuthorizationRequest;
if (request != null)
{
Guid siteId = Guid.Parse(request.ClientIdentifier);
Boolean isAuthenticated = this._identityProviderManager.Authenticate(siteId, "FA", username, password);
if (isAuthenticated)
{
var serviceHost = new AuthorizationServerHost();
var authorizationServer = new DotNetOpenAuth.OAuth2.AuthorizationServer(serviceHost);
var approvalMessage = authorizationServer.PrepareApproveAuthorizationRequest(request, username, request.Scope);
return authorizationServer.Channel.PrepareResponse(approvalMessage).AsActionResult();
}
}
return View();
}
Any ideas?