I have a console application and my first line is in the Main method is:
TaskScheduler.FromCurrentSynchronizationContext();
but here my application crashes with the System.InvalidOperationException
: Additional information: The current SynchronizationContext
may not be used as a TaskScheduler
. I've searched on the MSDN, but I didn't found a documentation for this method. What have I done wrong?