Just finished up my first mvc4 app. Everything is working great until I deploy it and I get: 500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed. every time I try to call /Account/Register or /Account/Login controllers:
I've snooped around in firefox console and fiddler. I didn't find anything useful there, but then again I don't really know what I should even be looking for.
Some other posts say to check the server log but that's a problem in itself because when I try to download, move, view, or delete the latest log file I get errors like "file transfer failed", "550 cant access file", "500 failed to delete file".
I don't know what else to do, some please advice. Heres some code for call to Login controller. I won't post Register version since they seem related.
Ajax call:
$.ajax({
url: "/Account/Login",
type: "POST",
data: $('#loginForm').serialize(),
success: function (resultData) {
if (resultData.ok) {
...unrelated stuff...has call to resultData.message
}
}
});
Login controller:
[AllowAnonymous]
[HttpPost]
public ActionResult Login(LoginModel model)
{
if (ModelState.IsValid)
{
if (Membership.ValidateUser(model.UserName, model.Password))
{
FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);
return Json(new { ok = true, message = "Login successful." });
}
else
{
return Json(new { ok = false, message = "The username or password you entered is invalid. Please try again." });
}
}
// If we got this far, something failed, redisplay form
return View(model);
}
It all seems pretty standard here so I really don't know what it could be or how to even diagnose
I ran into a similar issue, which was a result of certain referenced DLLs not being present in the GAC of the server (only on the dev machine with the MVC4 beta installed). The solution was to set those dependencies to "Copy to Local" before compilation
* System.Web.Mvc
* System.Web.Routing
* System.Web.Abstractions
* Microsoft.Web.Infrastructure
* System.Web.Razor
* System.Web.WebPages.Deployment
* System.Web.WebPages.Razor
If you're having the same problem these links will help you solve it:
Could not load file or assembly 'System.Web.Mvc'
http://haacked.com/archive/2008/11/03/bin-deploy-aspnetmvc.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With