SvcUtil.exe
Parameters
1/async
/async generates both synchronous and asynchronous method signatures.
Default setting: Only the synchronization method signature is generated.
Abbreviated form:/A
2/tcv:version35
/tcv:version35
Specifies which version of the. NET Framework the application is targeting. Valid values are: Version30 and Version35. The default value is Version30.
Abbreviated form:/TCV
VERSION30: If code is generated for clients using the. NET Framework 3.0,/tcv:version30 is used.
VERSION35: If code is generated for clients using the. NET Framework 3.5,/tcv:version35 is used. If the/tcv:version35
Used with the/async switch, an event-based asynchronous method and an asynchronous method based on a callback/delegate are generated at the same time.
3/collectiontype:< type >
/collectiontype:< type >
When you generate code from a schema, you specify the fully qualified or assembly-qualified name that you want to use as the collection data type.
Abbreviated form:/CT
4/reference:< file path >
/reference:< file path >
Refers to the type in the specified assembly. Use this option when generating clients to specify which assemblies may contain types that represent the imported metadata.
You cannot use this switch to specify message contracts and XmlSerializer types.
If DateTimeOffset is referenced, the type is used instead of the new type is generated. If the application is written using the. NET Framework 3.5
, SvcUtil.exe will automatically refer to DateTimeOffset.
Abbreviated form:/R
5/enabledatabinding
/enabledatabinding
Implement the INotifyPropertyChanged interface on all data contract types to enable data binding.
Abbreviated form:/edb
Example:
1
Generate synchronization, asynchronous code with events, collection using System.Collections.ObjectModel.ObservableCollection collection, specifying assembly reference
svcutil/a/d:d:/temp http://localhost:1998/Implement/AgriProductService.svc/ser:DataContractSerializer
/TCV: Version35/ct:system.collections.objectmodel.observablecollection ' 1/reference:c:/"program
Files"/"reference Assemblies "/microsoft/framework/.netframework/v4.0/windowsbase.dll
Generates synchronous, asynchronous code with events, collection using System.Collections.Generic.List collection
svcutil/a/d:d:/temp http://localhost:1998/Implement/AgriProductService.svc/ser:DataContractSerializer
/TCV: Version35/ct:system.collections.generic.list ' 1
Generate synchronization, asynchronous code with events, collection map to arrays
svcutil/a/d:d:/temp http://localhost:1998/Implement/AgriProductService.svc/ser:DataContractSerializer
/TCV: Version35
A detailed introduction to svcutil.exe.
ServiceModel Metadata Utility (Svcutil.exe)
If the generated proxy class is to be used for Silverlight, you will need to modify it manually. Because Silverlight does not support synchronization, all code that needs to delete synchronization operations in the proxy class retains only asynchronous code, as well as the need to add the following code for the open and close client code.