After more testing, I think I have my answer.

Thanks, Tom, for giving me a kick with that other method you linked. The method cited there (just send WM_QUIT to IISExpress.exe) worked. But the funny thing is, it didn't work every time for me. This made me question my assumptions.

Rolling back my steps and retrying, I discovered that even TASKKILL /IM IISExpress.exe works, as long as I don't do /F to force kill. Both methods are a graceful stop of the process. But I was, in my experiments, getting different results depending on whether I pressed Q or whether I used an external force to close IISExpress.exe. Pressing Q got me the code coverage results, other methods did not.

Turns out it was a PEBKAC error: I was iterating so quickly on different methods trying to get this to work, that in some important situations I was missing an intermediate step in my experiments: Actually logging into the web site to make it generate some code coverage for me. Some of the cases where I wanted to get code coverage results, I had forgotten to take any actions which would have generated any code coverage. So I was messing up my assumed results by not actually doing all the necessary steps every time. This made me make a bunch of wrong assumptions about which methods worked and which did not.

Turns out that the simple solution: TASKKILL /IM IISExpress.exe, was right all along, and it was just my stupidity that prevented it from working.

At least I think that's the case for now, and I'm going to move forward with more experiments to make sure this is solid.

Thanks!
_________________________
Tony Fabris