0

When I try to run the Contact Manager program for asp.net core 2.1, I get an ArgumentNullException error when the program tries to seed the database.

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)`.

The repo is part of the asp.net core 2.1 documentation and can be found here: https://docs.microsoft.com/en-us/aspnet/core/security/authorization/secure-data?view=aspnetcore-2.1

ekad
  • 13,718
  • 26
  • 42
  • 44
ephraimf
  • 9
  • 3
  • A `ArgumentNullException` would mean that your uid is null, not what is being returned by `FindByIdAsync` – emsimpson92 May 30 '18 at 21:02
  • Possible duplicate of [What is a NullReferenceException, and how do I fix it?](https://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it) – sticky bit May 30 '18 at 23:23

0 Answers0