6.0

Table Of Contents
VMware, Inc. 21
Chapter 3 Setting Up for Microsoft C# Development
7 Annotate the VimService class in the VimService.cs file that you generated in Step 3, adding this
XmlSerializerAssemblyAttribute to point to the location of the XML serializer assembly:
[System.Xml.Serialization.XmlSerializerAssemblyAttribute(AssemblyName =
"Vim25Service.XmlSerializers")]
The result should look something like the following example:
// ... Some code here ...
[System.Xml.Serialization.XmlSerializerAssemblyAttribute(AssemblyName =
"Vim25Service.XmlSerializers")]
public partial class VimService : Microsoft.Web.Services3.WebServicesClientProtocol {
// ... More code here.
8 Save the modified VimService.cs file.
9 Regenerate the Vim25Service.dll library with the following command syntax:
csc /t:library /out:Vim25Service.dll /r:"%WSE_HOME%\Microsoft.Web.Services3.dll" VimService.cs
10 Copy the generated files Vim25Service.dll and Vim25Service.XmlSerializers.dll to the
%SDK_HOME%\vsphere-ws\dotnet\cs\samples\lib directory.
copy Vim25Service*.dll lib
Building the C# Sample Programs
The vSphere Web Services SDK contains sample clients that demonstrate how to perform functions to manage
your datacenter. The samples are organized into individual Visual Studio projects, which are collected in a
single solution file. This document explains how to build the entire solution set.
Build the C# Sample Programs
The C# sample clients demonstrate functions that you can use to manage your datacenter. The build process
varies, depending on the version of Visual Studio. The process is illustrated in Figure 3-1 and described in “To
build the C# sample programs on page 23.