当我尝试为 asp.net core 2.1 运行 Contact Manager 程序时,当程序尝试为数据库设置种子时,我收到 ArgumentNullException 错误。
System.AggregateException
HResult=0x80131500
Message=One or more errors occurred.
Source=ContactManager
StackTrace:
at ContactManager.Program.Main(String[] args) in C:\Users\EphraimF\source\repos\CMfinal\Program.cs:line 41
Inner Exception 1:
ArgumentNullException: Value cannot be null.
The error in generated because a null is returned by `userManager.FindByIdAsync(uid)`.
该 repo 是 asp.net core 2.1 文档的一部分,可在此处找到:https ://docs.microsoft.com/en-us/aspnet/core/security/authorization/secure-data?view=aspnetcore-2.1