Try like below
var task1 = new Task(() =>
{
serversocketProg.HandleIncomingFile(port, CreateLocalSysIPDirOnServer)
});
Task task2 = task1.ContinueWith(antecedent =>
{
fillLogFileInGrid(clientLogDir);
}, TaskScheduler.FromCurrentSynchronizationContext()
);
task1.Start(TaskScheduler.FromCurrentSynchronizationContext());
Hope this helps