1

I have been using Slsvcutil for some time to generate proxies for my WCF service, that would be compatible with Xamarin.ios. I had never had a problem. However, today, I attempted to update my proxy, and the resulting contract was incomplete.

Previously I would use the command line:

"C:\Program Files (x86)\Microsoft SDKs\Silverlight\v5.0\Tools\\SlSvcUtil.exe" http://localhost/Service.svc /out:Service.cs

And it would generate a Data Contract service. Now it generates a service file containing only XmlSerialization attributes - which obviously won't work for me.

So, I modified my command line arguments to force DataContract serialization:

"C:\Program Files (x86)\Microsoft SDKs\Silverlight\v5.0\Tools\\SlSvcUtil.exe" http://localhost/Service.svc /mc /serializer:DataContractSerializer /out:Service.cs

This correctly results in DataContract serialization, however, my C# proxy completely omits all the message-contracts (which I had believed the /mc was supposed to fix). All of the method signatures accept "object" as argument, where previously they were proper, full contracts, describing all the argument members.

The only difference I can see is the version of runtime has changed... (as marked in the header of the generated proxy files):

Before

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.18449
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

After

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.34014
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
Adam
  • 4,159
  • 4
  • 32
  • 53

0 Answers0