0

having a weird issue... I'm passing an interface as a parameter to an asynchronous method and it never executes (breakpoint, debug.break, etc never hit). As follows:

ITestClass test = new TestClass();
IAsyncResult asyncResult = serviceProxy.beginWork(test);

The Work() method never, well, works! No breakpoint is hit inside the Work() method and no error is ever thrown. I can get Work() to work if I do as follows

IAsyncResult asyncResult = serviceProxy.beginWork(new QueueServiceClient());

-or-

IAsyncResult asyncResult = serviceProxy.beginWork(null);

Any ideas or rules that I don't know about passing an interface into an asynchronous method in C#?

  • 1
    Can you show `beginWork` implementation? – Hamlet Hakobyan May 15 '14 at 23:06
  • Make sure that your interface `ITestClass` has `KnownType` attribute for the derived types. WCF needs this to function. – Haney May 15 '14 at 23:29
  • Turn on [WCF trace](http://stackoverflow.com/questions/4271517/how-to-turn-on-wcf-tracing) and have a look at the log. That way you can at least get more information of what went wrong. – Edin May 17 '14 at 22:23

0 Answers0