Entity Framework – Debugging a Seed method from the Package Manager Console

Posted by

On the odd occasion you wish to debug Seed method code which has been executed from the Package Manager Console using the Update-Database command, a quick and dirty method is to add the following code:

if (!System.Diagnostics.Debugger.IsAttached)

Yes it’s dirty! It will however fire up a new Visual Studio debug window and allow you to see what’s going on inside.

Terry Butler