I'm getting the following error when I attempt to inherit my dbcontext in an asp.net core 2.0 library from IdentityDbContext:
Error CS0012 The type 'IdentityRole' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Extensions.Identity.Stores, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
When I attempt to install the pkg I get:
Unable to find version '2.0.0' of package 'Microsoft.Extensions.Identity.Stores'. At line:1 char:1 + Install-Package Microsoft.Extensions.Identity.Stores -Version 2.0.0 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], Exception + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
I've been going round and round with this for two days. Hopefully a solution will come soon...
Because I had the same problem: Add the nuget package via Package Manager Console to your project.
Install-Package Microsoft.Extensions.Identity.Stores -Version 2.0.2
And choose the correct nuget package version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With