My code :
void Method(){
Task T = Task.Factory.StartNew(() =>
{
for (int i=0;i<count;i++)
{
textBox1.Text += "x";
Thread.Sleep(500);
}
});
T.Wait();
}
I want to this task wait until everything ends and then exists the method and the main thread resume its work...
But i get AggregateException was unhandled
Error on T.Wait();
What's wrong with this ?