This post describes the easiest way to debug the issues that may stop your Seed-method in Configuration.cs from going through. The solution here shows you, how you can get a little bit more information out of the process, without attaching the debugger (there’s another blog post for that!)
Entity Framework’s code-first migration’s are a beautiful and easy way of managing database schema changes and populating some preliminary data there. Personally I also sometimes use the method for adding some enrichment to data or or custom property values mapping that would otherwise require an additional/external console program.
Problem: running the Seed-method is by default undebuggable
Okay – so seeding data is cool. That’s fine and dandy, but debugging the issues in the function while running Update-Database is NOT so cool. You only get the stacktrace and exception message – and that’s pretty ugly.