masoud.try
سه شنبه 03 آذر 1394, 16:27 عصر
سلاخ خسته نباشید من دارخل برنامم دارم از Identity استفاده میکنم ولی یه مشکل دارم وقتی میخوام کاربر رو Login کنم.
موقع ساختن UserIdentity خطای زیر رو میده.
Cannot create file 'C:\****.mdf' because it already exists. Change the file path or the file name, and retry the operation.
اینم کدی که زدم.
var authonticationManager = HttpContext.GetOwinContext().Authentication; var userstor = new UserStore<ApplicationUser>();
var userManager = new UserManager<ApplicationUser>(userstor);
var userIdentity =
await userManager.CreateIdentityAsync(user,
DefaultAuthenticationTypes.ApplicationCookie);
authonticationManager.SignIn(new AuthenticationProperties()
{ IsPersistent = model.RememberMe },
userIdentity);
return View("Index", model);
پیشاپیش ممنون ازکمکتون.
موقع ساختن UserIdentity خطای زیر رو میده.
Cannot create file 'C:\****.mdf' because it already exists. Change the file path or the file name, and retry the operation.
اینم کدی که زدم.
var authonticationManager = HttpContext.GetOwinContext().Authentication; var userstor = new UserStore<ApplicationUser>();
var userManager = new UserManager<ApplicationUser>(userstor);
var userIdentity =
await userManager.CreateIdentityAsync(user,
DefaultAuthenticationTypes.ApplicationCookie);
authonticationManager.SignIn(new AuthenticationProperties()
{ IsPersistent = model.RememberMe },
userIdentity);
return View("Index", model);
پیشاپیش ممنون ازکمکتون.