PDA

View Full Version : حرفه ای: مشکل در ساختن CreateIdentityAsync



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);


پیشاپیش ممنون ازکمکتون.

hadi0x7c7
پنج شنبه 05 آذر 1394, 19:59 عصر
برید اون فایل رو پاک کنید ببینید چه اتفاقی میفته.