当我尝试运行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