I was doing some tests with the TPL and async/await and noticed something that I find unexpected: I was scheduling work to run using lambdas and Task.Run, for instance:
Task.Run(()=>Console.WriteLine("Nice program"));
And then I realized that if program immediately returns the work is never executed. Is that the expected behavior in any .NET application (WPF, Forms, etc.)? Is there any documentation that discusses this?
This means that Task.Run is actually a no-go for fire-and-forget scenarios.