“Asynchronous operations are not allowed in this context”

Check out this answer. I won’t copy/paste the answers from there but I’ll extend the discussion some.

The accepted answer is NOT the correct one. Since there is no ‘EndInvoke’ there will be a resource leak every time this method is invoked. See this discussion on why that’s not okay.

What is suggested instead is to launch either a daemon thread or create whole different processes that reads from MSMQ and processes the long-running tasks there.

Leave a Comment