1

I am working in ASP.NET MVC5 attempting to make a fairly simple program for a school assignment.

I got this error... Error Message

because of this line of code:

        context.Facilities.AddOrUpdate(x => x.ID, new Facility() { ID = 1, FacilityAddressId = 1, Name = "School Playground", OwnerId = 1, Indoor = false, Sport = "soccer" });

I have now fixed the error. It turns out the foreign key "OwnerId" was referencing an empty table. My question is:

How could I have viewed the "inner exception" in my error message to help with the debugging process (the text in the console is plain text, not a link)

  • 1
    Possible duplicate of [An error occurred while updating the entries. See the inner exception for details](https://stackoverflow.com/questions/15466854/an-error-occurred-while-updating-the-entries-see-the-inner-exception-for-detail) –  May 11 '18 at 07:18
  • My exception occurs in the console and my question is how to view the error. –  May 11 '18 at 12:07
  • 1
    https://stackoverflow.com/questions/17169020/debug-code-first-entity-framework-migration-codes – Steve Greene May 14 '18 at 17:15
  • Yes! Thank you, this is exactly what I needed to see! –  May 14 '18 at 19:28
  • Hello Please check Your sql Permissions, and allow your user permissions. – muddassar shabbir Mar 05 '19 at 07:13

0 Answers0