VMware {code} Community
noxsertrue
Contributor
Contributor
Jump to solution

C# wrapper not able to connect to VMWorkstation error 22002

Hello, my problem is that I can't connect to my VMWorkstation with the following code

using System;

using System.Collections.Generic;

using System.Text;

using VixCOM;

namespace VIXTest

{

class Program

{

static void Main(string[] args)

{

VixCOM.VixLib lib = new VixCOM.VixLib();

Console.WriteLine("Connecting...");

VixCOM.IJob job = lib.Connect(VixCOM.Constants.VIX_API_VERSION, VixCOM.Constants.VIX_SERVICEPROVIDER_VMWARE_WORKSTATION, "", 0, "", "", 0, null, null);

object[] data = { VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE };

object results = null;

ulong err = job.Wait((VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE), ref results);

if (lib.ErrorIndicatesFailure(err))

{

int errCode = lib.ErrorCode(err);

string errMsg;

errMsg = lib.GetErrorText(err, null);

Console.WriteLine("Error: " + errCode.ToString() + " : " + errMsg);

}

exit(true);

}

static void exit()

{

exit(false);

}

static void exit(bool prompt)

{

if (prompt)

{

Console.Write("Press Any Key To Exit");

Console.ReadKey();

}

System.Environment.Exit(-1);

}

}

}

I'm using VMWorkstation 7.1 on a Windows7 64bit-Client - my Script runs in 32bit.

The logfile writes this - although there is no config point to esx-4 in my vixwrapper-config.txt-File???

May 31 14:48:10.621: app-6644| Log for VixWrapper pid=7140 version=1 build=build-207905 option=Release

May 31 14:48:10.621: app-6644| The process is 32-bit.

May 31 14:48:10.621: app-6644| Host codepage=windows-1252 encoding=windows-1252

May 31 14:48:10.621: app-6644| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX
ws_server_esx-4\32bit\vix.dll'

May 31 14:48:10.621: app-6644| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX
ws_server_esx-4\32bit\vix.dll'

May 31 14:48:10.621: app-6644| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX
ws_server_esx-4\32bit\vix.dll'

May 31 14:48:10.621: app-6644| config points to non-existent implementation library 'C:\Program Files (x86)\VMware\VMware VIX
ws_server_esx-4\32bit\vix.dll'

May 31 14:48:10.621: app-6644| Workstation installed version is 7.1.0

May 31 14:48:10.621: app-6644| No implementation found for service provider 3, apiVersion -1 installedVersion 7.1.0

May 31 14:48:10.621: app-6644| No Vix library found for provider 3 revision -1

May 31 14:48:10.621: app-6644| No implementation libraries loaded, cannot call 'Vix_GetErrorText'

Thanks, for any help - meanwhile I tried many C#-Wrappers - all got the problem, that the can't connect to my VMWorkstation.

Reply
0 Kudos
1 Solution

Accepted Solutions
stanguturi
VMware Employee
VMware Employee
Jump to solution

Reply
0 Kudos
2 Replies
stanguturi
VMware Employee
VMware Employee
Jump to solution

You're probably hitting the issues reported in the following threads.

http://communities.vmware.com/thread/269387?tstart=0

http://communities.vmware.com/thread/264251?tstart=0

-Thanks

Sankar.

Reply
0 Kudos
noxsertrue
Contributor
Contributor
Jump to solution

Thanks - the following line in the vixconfig-wrapper-File solved the problem:

ws 9 vmdb 7.1.0 Workstation-7.0.0

Reply
0 Kudos