The following code example shows the Csc task being executed inside of a Target element. The items and properties passed to the task parameters are declared outside of the scope of this example. The value from the output parameter OutputAssembly is stored in the FinalAssemblyName item, and the value from the output parameter BuildSucceeded is stored in the BuildWorked property. For more information, see MSBuild Tasks.
<Target Name="Compile" DependsOnTargets="Resources">
<Csc Sources="@(CSFile)"
TargetType="library"
Resources="@(CompiledResources)"
EmitDebugInformation="$(includeDebugInformation)"
References="@(Reference)"
DebugType="$(debuggingType)"
OutputAssembly="$(builtdir)\$(MSBuildProjectName).dll" >
<Output TaskParameter="OutputAssembly"
ItemName="FinalAssemblyName" />
<Output TaskParameter="BuildSucceeded"
PropertyName="BuildWorked" />
</Csc>
</Target>