Okay, this is more of a .NET Framework question...actually I'm using VB.NET...but I don't think that part matters. Here's the issue:
I create a process object
I start the process object
I wait for exit
Everything is Okay until here
Now I want to get some info from the process, for example the PeakWorkingSet or maybe PeakVirtualMemorySize. I get an exception, the stated reason being that the process has already exited. Is there any way around this?
I read something on the net that indicated that this is the intended behavior. NOOO!!!!
This just seems crazy to me, because some of this info isn't even that interesting UNTIL the process has exited, and in other cases (for example I start the process then try to fetch the PID then wait for exit) I will still get the exception because the process runs so quickly that I don't even get a chance to look at the properties of it. And, being a c programmer, I KNOW that this info really does persist at the OS level even after the process exits (until the programmer discards hProcess or hKernelJobObject). What gives?! I really don't want to rewrite all of the Process code using unmanaged calls if I don't have to...