Couple of comments on constructors etc.

Oct 20, 2009 at 10:10 PM


Well done, I found your project very helpful in creating more robust WCF clients. Thank you. I've a couple of comments on the generated code though, I generated a ExceptionHandlingDuplexProxyBase but I beleive this applies equally to the ExceptionHandlingProxyBase

1. A default constructor is generated, I think it should be omitted as it appears to create an unitialised object (same for the generated {ServiceName}DuplexProxy<C> class)?

2. There is no constructor which only accepts a callback object unlike the MS generated proxies, I believe the following works (again same for generated {ServiceName}DuplexProxy<C>)

public ExceptionHandlingDuplexProxyBase(C callbackObject)
    Initialize(callbackObject, "*");

 3. In {ServiceName}DuplexProxy<C>, the InnerChannel_Closed event handler calls OnClosed() which in turn recreates the channel. So it appears that if the client calls ICommuncationObject.Close() then the channel gets recreated?  Is this by design - I personally think it should only recreate the channel if it's faulted (or closed at the remote end) but that might have side effects you're aware of and I'm not?