Developing on Staxmanade

WCF - Silverlight - Default constructor not called??

Can anyone explain why creating a default constructor (defined in a partial class) of an auto-generated Service References class for an object. Does not get executed when the object is created by a WCF service call?

I'll go through some of the basic steps I did to reproduce this, and I'll attach the project I created to do so. I would love if anyone had some insight into this... SilverlightWcfConstructorTest.zip

1. Create a web service that returns some complex type. (Class1)

2. Create a Silverlight app that can consume the service above. (Use the Add Service Reference so it will auto-generate a service reference file).

3. (in Silverlight) Create a partial class to extend the Class1 created by the service reference

4. Add a default constructor to this partial class.

5. Do something in this constructor to hint that it is called.

6. Run it and see that the default constructor is never called when making a WCF Silverlight service call.


WHY?


I have a full project put together that you should be able to unzip and run to see this behavior…

SilverlightWcfConstructorTest.zip


Update: I have a thread started at the silverlight forums on this topic...