I\'m using the new ASP.NET MVC 5 Identity framework for authentication. I\'ve traditionally used StructureMap for dependency injection, but I\'m having problems wiring it u
@vikram, this worked for me.
cfg.For<IRoleStore<IdentityRole,string>>().Use<RoleStore<IdentityRole>>();
Adding [DefaultConstructor] Attribute will work.
public class AccountController : Controller
{
private ApplicationSignInManager _signInManager;
private ApplicationUserManager _userManager;
[DefaultConstructor] //This is the attribute you need to add on the constructor
public AccountController()
{
}
// Other implementations here..........
}
Add following code to your Container initialize method.
x.For<Microsoft.AspNet.Identity.IUserStore<ApplicationUser>>()
.Use<Microsoft.AspNet.Identity.EntityFramework.UserStore<ApplicationUser>>();
x.For<System.Data.Entity.DbContext>().Use(() => new ApplicationDbContext());