How are custom tasks terminated

Hi:

I've written some custom tasks, and I have a question about how they are terminated. For example: I have one task which runs a separate process. If I start MSBuild and then do a control-C, MSBuild is killed, by my process is still running. My task never receives an exception. Is there some way I can find out that MSBuild is terminating and hold up the termination long enough for me to clean-up whatever my task is doing before allowing MSBuild to terminate



Answer this question

How are custom tasks terminated

  • naila

    Thanks. Sorry to hear that there isn't a solution, but you definately saved me a bunch of time looking for a better one. I've submitted the appropriate feedback as you've suggested so hopefully it will be added in a future release. It seems simple enough to do so.


  • heavenode

    MSBuild doesn't register to get called on the app-domain event that indicates that ctrl-c was hit. Probably we should - that would be a minor new feature - and probably we should force spawned processes to die when we get called on it.

    So in short unfortunately there's no good way I can see for you to do this at present. Unless possibly you create your own appdomain, but that's rather excessive.

    If this feature is important to you, maybe you could post the suggestion on the msdn product feedback center. Those suggestions go into our product planning.

    Dan

    'this posting provided as-is with no warranties'



  • How are custom tasks terminated