Where can I find the console or debug output from code executed in the package manager window?

DanielEli picture DanielEli · Mar 30, 2012 · Viewed 13.7k times · Source

I'm using EntityFramework code first with migrations. From the package manager console, I'm running "update-database". This executes Configuration.Seed(context) which I have overridden.

    protected override void Seed(WebContext context)
    {

        Console.WriteLine("Console Test");
        Debug.WriteLine("Debug Test");
        Trace.WriteLine("Trace Test");
    }

Where can I find that output?

Better yet, How do I output back to the package manager window?

Thx, Dan

Answer

George Johnston picture George Johnston · Mar 12, 2013

A quick hack I use to be able to quickly find a value in my Seed method is simply to throw an exception with a value I care about, e.g.

throw new Exception(yourValue);

This errors out the Seed, but my exception/value appears in my package manager console.