SynchronizationContext.Current
is null on Main thread and I have had a hard time figuring this one out.
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
var ctx = System.Threading.SynchronizationContext.Current;
// ctx is null here
}
}
I am running on .NET 4.6.1. It is a mixed Winforms and WPF app. The entry point is WinForms. Here are some screenshots of such evidence:
It is also not related to posts like this as I am using newer .NET version and seems mentioned issue was patched already. Any other good ideas?