SGen Task
 

Creates an XML serialization assembly for types in the specified assembly. This task wraps the XML Serializer Generator Tool (Sgen.exe). For more information, see XML Serializer Generator Tool (Sgen.exe).

The following table describes the parameters of the SGen task.

ParameterDescription
BuildAssemblyNameRequired String parameter.

The assembly to generate serialization code for.
BuildAssemblyPathRequired String parameter.

The path to the assembly to generate serialization code for.
DelaySignOptional Boolean parameter.

If true, specifies that you want a fully signed assembly. If false, specifies that you only want to place the public key in the assembly.

This parameter has no effect unless used with either the KeyFile or KeyContainer parameter.
KeyContainerOptional String parameter.

Specifies a container that holds a key pair. This will sign the assembly by inserting a public key into the assembly manifest. The task will then sign the final assembly with the private key.
KeyFileOptional String parameter.

Specifies a key pair or a public key to use to sign an assembly. The compiler inserts the public key in the assembly manifest and then signs the final assembly with the private key.
PlatformOptional String parameter.

Gets or Sets the Compiler Platform used to generate the output assembly. This parameter can have a value of x86, x64, or anycpu. Default is anycpu.
ReferencesOptional String[] parameter.

Specifies the assemblies that are referenced by the types requiring XML serialization.
SdkToolsPathOptional String parameter.

Specifies the path to the SDK tools, such as resgen.exe.
SerializationAssemblyOptional ITaskItem[] output parameter.

Contains the generated serialization assembly.
SerializationAssemblyNameOptional String parameter.

Specifies the name of the generated serialization assembly.
ShouldGenerateSerializerRequired Boolean parameter.

If true, the SGen task should generate a serialization assembly.
TimeoutOptional Int32 parameter.

Specifies the amount of time, in milliseconds, after which the task executable is terminated. The default value is Int.MaxValue, indicating that there is no time out period.
ToolPathOptional String parameter.

Specifies the location from where the task will load the underlying executable file (sgen.exe). If this parameter is not specified, the task uses the SDK installation path corresponding to the version of the framework that is running MSBuild.
TypesOptional String[] parameter.

Gets or sets a list of specific Types to generate serialization code for. SGen will generate serialization code only for those types.
UseProxyTypesRequired Boolean parameter.

If true, the SGen task generates serialization code only for the XML Web service proxy types.

In addition to the parameters listed above, this task inherits parameters from the ToolTaskExtension class, which itself inherits from the ToolTask class. For a list of these additional parameters and their descriptions, see ToolTaskExtension Base Class.

Task Reference
Tasks
MSBuild Concepts