Here is a snippet of code in c#/.net
string stdout = server.Jobs.Tasks.GetOutputString(OutputInfoClass.OutputT.StandardOutput, JobID, task.Id, true);
string stderr = server.Jobs.Tasks.GetOutputString(OutputInfoClass.OutputT.StandardError, JobID, task.Id, true);
stdout will fill incorrectly, but stderr will be an empty string.
If I run the second line again it will populate stderr correctly. Is there some kind of flush I am missing?