i get the following exception when trying to configure Unity using Unity.Mvc5 with an MVC 5 application using Identity 2.0 and the Identity 2.0 Samples boilerplate. i have read
I see you found a solution, but I think I have a simpler one.
You're using Entity Framework, right? So your application almost certainly has something inheriting from DbContext
(probably inheriting from IdentityContext
, which in turn inherits from DbContext
in this case). In the default template it's ApplicationDbContext.
In your composition root you can just add container.RegisterType
(obviously edit this if yours isn't called ApplicationDbContext).