c# - How to continue execution of code only when windows service is completed? -


i have windows service performs long running task. @ moment, spawn new thread, executes method goes off , calls windows service. code looks like:

thread thread = new thread(new threadstart(execyutelongrunningmethod)); thread.start(); thread.join(); 

higher in callstack (when code done), message box popups stating result of operation.

however, while block of code executes (executelongrunningmethod calls windows svc), message box popups stating nothing has changed result of operation, because before code block above has completed, wrong message box appears.

thus, question is, proper way continue execution in winforms app (this calls windows svc), when windows service finished? thinking approach above incorrect thread call windows service (another process), while windows service stuff, code (winforms app) continue. either sort of signaling required, or named pipes?

the app in .net 3.5.

thanks

expose status of service execution via wcf api , call using nettcp or named pipes, poll service or use wcf callback.


Comments