Considering this code works on a GUI and not as a service i thought it would be a problem with using the synchronizationcontext which is why i didn't provide the exception. Sorry about that.

The code i posted is throwing this error when wrapped in a try catch block:

Sytem.NullReferenceException {"Object reference not set to an instance of an object."}

It was captured in MessageClientServerBase.vb

Is there any other part of the exception you need..?

The only thing i can think of is that because there is no UI thread in a windows service, this is causing the problem but yeah im unsure of how to resolve it.