This code waits indefinitely on the t.Wait()
line.
void Main()
{
Foo.Bar();
}
public static class Foo
{
static Foo()
{
var t = Task.Factory.StartNew (() => 1);
t.Wait();
"Done".Dump();
}
public static void Bar()
{
}
}
I would expect the task to run and finish immediately. Any thoughts as to why? This doesn't seem to happen in instance constructors. v4.42.01