The following content from reference.svcmap shows the settings that Visual Studio 2010 uses to generate the proxy. [Note: You can access reference.svcmap in the client project in the Solution Explorer under your service reference, by selecting ‘Show all files” icon. It is hidden by default.]
<ClientOptions>
<GenerateAsynchronousMethods>false</GenerateAsynchronousMethods>
<EnableDataBinding>true</EnableDataBinding>
<ExcludedTypes />
<ImportXmlTypes>false</ImportXmlTypes>
<GenerateInternalTypes>false</GenerateInternalTypes>
<GenerateMessageContracts>false</GenerateMessageContracts>
<NamespaceMappings />
<CollectionMappings />
<GenerateSerializableTypes>true</GenerateSerializableTypes>
<Serializer>Auto</Serializer>
<UseSerializerForFaults>true</UseSerializerForFaults>
<ReferenceAllAssemblies>true</ReferenceAllAssemblies>
<ReferencedAssemblies />
<ReferencedDataContractTypes />
<ServiceContractMappings />
</ClientOptions>
Notice that in reference.svcmap, 'UseSerializerForFaults' is true - and this is exactly what we are trying to avoid in the workaround. The default is to use
DataContractSerializer and that is what gets used by using the command provided.
Also note that svcutil has a default of false for 'EnableDataBinding', 'GenerateSerializableTypes', 'UseSerializerForFaults' and 'ReferenceAllAssemblies'. To Enable DataBinding and Generate Serializable types, the command used in the workaround above uses /edb and /s. In order to reuse the types in the referenced assemblies, you need to provide each referenced assembly with a /r: switch
If you would like to get the equivalent of checking the 'message contract' checkbox in Visual Studio ASR (Add Service Reference), include /messageContract in your svcutil command.
If you would like to target a specific .NET version, say 3.5 - you can do so using /targetClientVersion switch
Below is an example of using svcutil command when enabling message contracts and targetting 3.5 Framework
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\SvcUtil.exe> svcutil
http://localhost/MyServices/Service.svc?WSDL /n:<targetNamespace>,<clientNamespace> /edb /mc /tcv:Version35
Referencehttp://msdn.microsoft.com/en-us/library/aa347733.aspx