Asp.net MVC4 - Internal Server Error 500 - Publish Only

Just finished my first mvc4 application. Everything works fine until I get it divorced, and I get: 500 - internal server error. There is a problem with the resource you are looking for and cannot be displayed. every time I try to call / Account / Register or / Account / Login controller:

Ive snooped in firefox console and fiddle. I did not find anything useful there, but again I do not know what I should even look for.

Some other messages say to check the server log, but this is a problem in itself because when I try to load, move, view or delete the last log file, I get errors such as “file transfer failure”, “access file 550 can not "," 500 failed to delete file ".

I do not know what else to do, some advice please. There is code to call the input controller. I will not publish the version as they seem to be 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 } } }); 

Input 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 looks pretty standard, so I really don’t know what it can be and how to even diagnose it.

+6
source share
1 answer

I had a similar problem that arose because certain DLL reference libraries were not present in the server's GAC (only on a dev machine with MVC4 beta installed). The solution was to set these dependencies to "Copy to local" before compiling

 * 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 have the same problem, these links will help you solve this problem:

Failed to load file or assembly "System.Web.Mvc"

http://haacked.com/archive/2008/11/03/bin-deploy-aspnetmvc.aspx

+3
source

Source: https://habr.com/ru/post/911381/


All Articles