Hello ,
I am facing a problem in using VIX api clone function with c# following is the sample code and the exception i am facing o can ssome help me by telling me whatz wrong with the code
-
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VIX;
using Vestris.VMWareLib;
namespace ConsoleApplication10
{
class Program
{
static void Main(string[] args)
{
VIX.Host kl = VIX.VixCOMWrapper.Instance.Connect(VIX.Enums.VIX_SERVICEPROVIDER.VMWARE_WORKSTATION, "", 0, "", "");
VIX.VM vm = kl.OpenVM(@"E:\VMWares-xji\WIN2K3\Windows Server 2003 Standard Edition.vmx");
try
{
vm.Clone(VIX.Enums.VIX_CLONETYPE.FULL, "E:
VMWares-xji
clonedvm
kljh.vmx");
Console.WriteLine("clone taken");
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e.ToString ());
Console.ReadLine();
}
}
}
}
and the exception
-
System.NullReferenceException: Object reference not set to an instance of an obj
ect.
at VIX.VM.Clone(Snapshot snapshot, VIX_CLONETYPE cloneType, String destConfig
PathName)
at VIX.VM.Clone(VIX_CLONETYPE cloneType, String destConfigPathName)
at ConsoleApplication10.Program.Main(String[] args) in C:\Users\MAI\Documents
\Visual Studio 2008\Projects\ConsoleApplication10\ConsoleApplication10\Program.c
s:line 21