This is the error iam getting after deployment but locally its working
System.Exception: Error in Login.
at MySQLSample.Controllers.AccountController.<login>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at lambda_method(Closure , Task )
at System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass34.<begininvokeasynchronousactionmethod>b__33(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<invokeactionmethodfilterasynchronouslyrecursive>b__3c()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass45.<invokeactionmethodfilterasynchronouslyrecursive>b__3e()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass30.<begininvokeactionmethodwithfilters>b__2f(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass1e.<>c__DisplayClass28.<begininvokeaction>b__19()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass1e.<begininvokeaction>b__1b(IAsyncResult asyncResult)
What I have tried:
This is what i have tried
public async Task<actionresult> Login(LoginViewModel model, string returnUrl)
{
if (ModelState.IsValid)
{
try
{
var user = await UserManager.FindAsync(model.UserName, model.Password);
if (user != null)
{
await SignInAsync(user, model.RememberMe);
//return RedirectToLocal(returnUrl);
return RedirectToAction("CampaignList", "Campaign");
}
else
{
ModelState.AddModelError("", "Invalid username or password.");
}
}
catch (Exception e)
{
ObjUtil.LogError(e);
var exception = new Exception("Error in Login.");
throw exception;
}
}
// If we got this far, something failed, redisplay form
return View(model);
}
please help me in finding the way to fix it.Why is it running locally if there is a mistake in code. Please provide sugestions. Thank you.