3

I have a WCF web service that's being consumed by both Silverlight and .NET clients. In order to share the data contract types with both clients, the contracts are defined in two class libraries: one Silverlight and one .NET. The files defining the data contract types are shared between the two library projects via links.

Generation of a proxy to consume the service works nicely for .NET. Specifically, data contract types from my .NET class library are reused as expected.

However, generation of a Silverlight proxy via SlSvcUtil.exe does not reuse the data contract types. This is true whether I invoke SlSvcUtil.exe from the command line with the /r switch or use the "Add Service Reference" dialog from Visual Studio.

Through trial and error, I've determined that a single type utilized in a single service method is the source of this problem. If the service ceases to use this type, SlSvcUtil.exe generates the proxy as expected (with types reused from the data contracts assembly).

Now that I've narrowed the issue down to this type, I'm not sure what to look for next. The type does contain a member that implements IXmlSerializalble. Could that cause this behavior? What are some common causes for this? What are some good approaches for further troubleshooting?

Odrade
  • 7,409
  • 11
  • 42
  • 65

1 Answers1

2

I'm sure you've long since moved on from this, but I came across a similar problem this morning - I had a type that didn't have a default constructor. After adding one, the mysterious type went away when running SlSvcUtil. Why it would work properly with SvcUtil is beyond me, though. Hope this helps!

Mark Carpenter
  • 17,445
  • 22
  • 96
  • 149