About The C# .Net Samples - VMware VC-SRM4-A - vCenter Site Recovery Manager Developer's Manual

Site recovery manager api
Table of Contents

Advertisement

About the C# .NET Samples

Currently the SDK includes recovery‐plan sample code that you can build on .NET. You can build C# .NET 
samples using Microsoft Visual C# 2008 Express or Microsoft Visual Studio 2008. An earlier version of the SDK 
supported Visual Studio 2005. Visual Studio 2003 was never supported because of performance issues (.NET 
took a long time to instantiate the VimService class). 
To build sample code with Visual Studio 2008
1
Open a Visual Studio 2008 command prompt from the Windows Start Menu as follows:
Start > Programs > Visual Studio 2008 > Visual Studio Tools > Command Prompt
2
Start the Windows command prompt.
On 64‐bit Windows systems, run C:\Windows\SysWOW64\cmd.exe so the sample programs execute 
under Windows 32‐bit on Windows 64‐bit (WOW64).
3
Navigate to the SDK\samples\DotNet sub‐directory.
4
At the command prompt, type Build2008.cmd to execute the build commands. 
To build sample code with Visual C# 2008 Express
1
Select the default (Full) Microsoft Visual C# 2008 Express installation.
2
If you installed Visual C# 2008 Express in the default location, skip this step. Otherwise:
a
Create the System environment variable VSINSTALLDIR.
b
Set the VSINSTALLDIR environment variable to the location of the Microsoft Visual Studio tools, in 
the Common7 sub‐directory of the Microsoft Visual C# 2008 Express installation. Default locations are 
shown below. Use quotation marks around directory names that contain spaces, as these do.
"C:\Program Files\Microsoft Visual Studio 9.0\Common7"
"C:\apps\Microsoft Visual Studio 9.0\Common7"
If Visual C# Express is installed in its default folder C:\Program Files\Microsoft Visual Studio 9.0, 
you do not need to create or set the VSINSTALLDIR environment variable.
3
Open a Visual Studio 2008 command prompt from the Windows Start Menu as follows:
Start > Programs > Visual Studio 2008 > Visual Studio Tools > Command Prompt
4
Navigate to the SDK\samples\DotNet sub‐directory.
5
At the command prompt, type Build2008.cmd to execute the build commands.
The build process generates the RecoveryPlan sample program, which lists all recovery plans and optionally 
gets state for the specified recovery plan.
A sample build can be executed from the \bin or \debug directory of a project. You can also run samples from 
within Visual Studio, at the .NET command prompt.
To display help text for any application, you can run the application without any parameters.
To run the sample code from Visual Studio
1
Start Visual Studio.
2
Open the Sample2008.sln solution file. 
3
Change the Project Properties to specify the command line arguments:
a
From the Project menu, select Properties to display the Property Pages dialog.
b
In the Project_Name Property Pages dialog, select Configuration Properties—Debugging on the left.
c
In the right‐hand pane (under Start Options), select Command Line Arguments.
d
Click OK to save your changes.
VMware, Inc.
Chapter 2 SDK Installation and Setup
15

Advertisement

Table of Contents
loading

This manual is also suitable for:

Vcenter site recovery manager 5.0

Table of Contents