Is VMWareTasks 1.7 compatible with Workstation 10.0.1 and VIX 1.13 ?

394 views
Skip to first unread message

Ver zz

unread,
Dec 31, 2013, 7:08:52 AM12/31/13
to vmwar...@googlegroups.com
Hi guys!

I am using VMWare Workstation 10.0.1 (and VIX 1.13 that is installed with it). Now I need to manage my VMs with a C# app running on the host (win7 x64). I want to use VMWareTasks 1.7 for this but can't make it work.


I have added the reference to the Vestris.VMWareLib.dll and the using.

To test that everything is working, I copied the method GettingStartedWorkstation() to my class. But I can't build.

Building causes this error:
Error 163 The type 'Interop.VixCOM.ISnapshot' is defined in an assembly that is not referenced. You must add a reference to assembly 'Interop.VixCOM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1a2e7e25925ba452'.

When I add a reference to 'Interop.VixCOM.dll I get a number of errors:
Error 177 'Vestris.VMWareLib.VMWareSnapshot' does not contain a definition for 'RemoveSnapshot' and no extension method 'RemoveSnapshot' accepting a first argument of type 'Vestris.VMWareLib.VMWareSnapshot' ...
Error 176 'Vestris.VMWareLib.VMWareSnapshot' does not contain a definition for 'RevertToSnapshot' and no extension method 'RevertToSnapshot' accepting a first argument of type 'Vestris.VMWareLib.VMWareSnapshot'...
Error 164 'Vestris.VMWareLib.VMWareVirtualHost' does not contain a definition for 'ConnectToVMWareWorkstation' and no extension method 'ConnectToVMWareWorkstation' accepting a first argument of type 'Vestris.VMWareLib.VMWareVirtualHost'...
Error 166 'Vestris.VMWareLib.VMWareVirtualHost' does not contain a definition for 'Open' and no extension method 'Open' accepting a first argument of type 'Vestris.VMWareLib.VMWareVirtualHost'...
Error 169 'Vestris.VMWareLib.VMWareVirtualMachine' does not contain a definition for 'LoginInGuest' and no extension method 'LoginInGuest' accepting a first argument of type 'Vestris.VMWareLib.VMWareVirtualMachine'...
And so on... None of the methods in Vestris.VMWareLib used in GettingStartedWorkstation() are found.

I removed the reference to Interop.VixCOM and tried to build the VMWare tasks solution in VMWareTasks-1.7.zip, assuming the problem was the version of VIX (1.13 vs 1.11).

Trying to build the solution in VMWareTasks-1.7.zip is a total mess:
1. The build.cmd file makes assumptions on where Visual Studio is installed. Mine is not installed in ProgramFilesDir, so I had to edit build.cmd to make it build. (could be more user frendly)
2. I realized I had to install MSBuildCommunityTasks (have not seen this in any dependencies, but maybee I missed it?)
3. The file master.snk is missing in VMWareTasks-1.7.zip, so i downloaded vmwaretasks-master.zip from github and copied the file to 1.7 \Source

Now when I try to build WMWareLib or WMWareTools in VMWareTasks-1.7.zip I get a number of errors (have not tried to build the other projects):
Error 30 The name 'Constants' does not exist in the current context...
Error 24 The type or namespace name 'ICallback' could not be found (are you missing a using directive or an assembly reference?)...
I get the error 24 also for symbols: IHost, IHost2, IJob, Interop, ISnapshot, IVixHandle, IVM and IVM2


I don't know how to solve this. Interop.VixCOM.dll is created and has the same size as for Vix 1.11 (32Kb). But I don't know if it is right or wrong.

What is the problem?
Is it at all possible to use VMWare Tasks with Workstation 10.0.1 and Vix 1.13 ?

Please help, I am stuck!


Daniel Doubrovkine

unread,
Jan 1, 2014, 9:18:47 AM1/1/14
to vmwar...@googlegroups.com
First, make sure that your platform target is 32-bit, not Any CPU. This is because VixCOM is a native 32-bit COM DLL. Does this help?


--
You received this message because you are subscribed to the Google Groups "vmwaretasks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vmwaretasks...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--

dB. | Moscow - Geneva - Seattle - New York
code.dblock.org - @dblockdotorg - artsy.net - github/dblock

Ver zz

unread,
Jan 1, 2014, 12:18:39 PM1/1/14
to vmwar...@googlegroups.com
Hi Daniel!

I did have my platform target set to X64, but changing to x86 does not help. Same errors.

Also, I noticed that platform target for all projects in the 1.7.zip solution are set to Any CPU. Why, if it doesn't work?

One thing that is different though. I do not have Net 2.0 installed, so my target framework is Net 4.0. Do you think this could be the problem? (I personally doubt it, but I might be wrong of course)


Daniel Doubrovkine

unread,
Jan 2, 2014, 12:02:24 PM1/2/14
to vmwar...@googlegroups.com
Maybe this wants you to install VixCOM separately? 1.13 is not even available publicly and maybe it's not registered on the machine? I would install https://my.vmware.com/group/vmware/details?downloadGroup=VIXAPI112&productId=353 (1.12) and remove then re-add a reference to the COM DLL in your project.

If you want to build VMWareTasks, check out the source from https://github.com/dblock/vmwaretasks, don't use the source in the zip. I got a clean 64-bit machine on which I installed VixCOM 1.12 and code from g...@github.com:dblock/vmwaretasks.git, MSBuildTasks and the C# part of the project builds just fine.



--
You received this message because you are subscribed to the Google Groups "vmwaretasks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vmwaretasks...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ver zz

unread,
Jan 2, 2014, 3:45:57 PM1/2/14
to vmwar...@googlegroups.com

(I have no idea why VIX API can't be found when you go into Workstation product download pages on the VMWare site.)

I will install it and see if I can make it work. If not, I will install 1.12 and see if that works. If not, I will cry for help again.

I will report back.

Ver zz

unread,
Jan 2, 2014, 5:51:22 PM1/2/14
to vmwar...@googlegroups.com

I have now done the following:

  1. Installed VIX 1.13.1 and tested first with original files in VMWareTasks-1.7.zip and with the new Interop.VixCOM.dll I managed to generate. Same error.
  2. Uninstalled both WIX and Workstation and then installed Workstation 10.0.1 and then VIX 1.12.0.31680 from my admin user (I was unsure of whether I had first installed it from my ordinary user where I develop my app or from my admin user) 
  3. Tested with original files in VMWareTasks-1.7.zip. Same error.
The error I am getting is the first I mentioned in my original post: Error 163 The type 'Interop.VixCOM.ISnapshot' is defined... If I add a reference to Interop.VixCOM.dll, I get all the rest of the errors, just as before.

Could the problem be Workstation 10.0.1, not WIX. Daniel, could you try it on your machine with Workstation 10.0.1?
Or do you think the problem might have something to do with me developing under an ordinary user, not the admin user? Have you tested to build from an ordinary user, Daniel?

Any other ideas?

In the mean time, I will try to download the git source and build it.

Ver zz

unread,
Jan 2, 2014, 6:04:44 PM1/2/14
to vmwar...@googlegroups.com
Just came to think of something else. (and why do we still use this crappy google groups site, where you can't even edit your own messages. Duh!)

I have VirtualBox installed on the same machine as Workstation. It seems unlikely, but do you think that might have something to do with my problems?

Daniel Doubrovkine

unread,
Jan 2, 2014, 6:10:31 PM1/2/14
to vmwar...@googlegroups.com
I am actually developing in a VM these days, so I don't even have VMWare installed. I can resurrect a PC that has all that stuff, but I don't think this is going to help. Lets see if the source builds, first.

PS: just use email for groups


--
You received this message because you are subscribed to the Google Groups "vmwaretasks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vmwaretasks...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ver zz

unread,
Jan 3, 2014, 6:01:43 AM1/3/14
to vmwar...@googlegroups.com
I have now done the following:
  1. Cloned vmwaretasks from github.
  2. Managed to build the important stuff in vmwaretasks with VIX 12.0 installed. I had to start Visual Studio as administrator (in ordinary user, right click VS shortcut and select 'run as administrator') in order for VMWareComLib and VMWareComTools to get registered. Files Interop.VixCOM.dll, VMWareComLib.dll, VMWareComTools.dll, Version.dll, VMWareLib.dll and VMWareTools.dll all build OK (config is Debug). The size of Interop.VixCOM.dll is now 44kb instead of 32kb. Test projects and samples in vmwaretasks does not build OK, because my admin user does not have nunit installed. But I don't think that matters.
  3. Created new test solution with console app and pasted code in GettingStartedWorkstation(). Referenced newly built VMWareLib.dll.
  4. Started VS as admin and tried to build my console app. Same error as before:  Error 163 The type 'Interop.VixCOM.ISnapshot' is defined...
  5. Since first trying to use vmwaretasks, I have updated from VS2010 to VS2013 and have installed NET 4.5.1. I get exactly the same errors on VS2010 & VS2013, and on Net 4.0 and 4.5.1.
What now?

Ver zz

unread,
Jan 3, 2014, 9:30:03 AM1/3/14
to vmwar...@googlegroups.com

I have tried a number of things and now it looks as a problem with the registration of VMWareComLib.dll and VMWareComTools.dll.

I did the following:
  1. Copied vmwaretasks project folder to a shared folder that both my ordinary user and my admin user has access to:
  2. Instead of running VS as admin from my ordinary user, I logged in directly to my admin user.
  3. Checked that admin user has full access to project folders and files in shared folder.
  4. Deleted all files in all bin/Debug folders by hand.
  5. Started VS directly in my admin user and did a clean solution and then build solution on the project in the shared folder.
  6. Got two registration errors:
    Error 199 Cannot register assembly "E:\Shared\vmwaretasks\Source\VMWareComLib\bin\Debug\Vestris.VMWareComLib.dll" - access denied. Please make sure you're running the application as administrator. Access to the registry key 'HKEY_CLASSES_ROOT\VMWareComLib.VMWareRootSnapshotCollection' is denied. VMWareComLib
    Error 200 Cannot register assembly "E:\Shared\vmwaretasks\Source\VMWareComTools\bin\Debug\Vestris.VMWareComTools.dll" - access denied. Please make sure you're running the application as administrator. Access to the registry key 'HKEY_CLASSES_ROOT\VMWareComTools.GuestOS' is denied. VMWareComTools
  7. So I thought something must be wrong with the registry keys. Started regedit and deleted all 'HKEY_CLASSES_ROOT\VMWareComLib.* and 'HKEY_CLASSES_ROOT\VMWareComTools.* keys from the registry.
  8. Tried to build again, but still getting the same errors. Only now none of these keys are in the registry.
Is it really necessary to register the two DLLs? I thought the precompiled DLLs in VMWareTasks-1.7.zip could be used just by adding a reference, without any registration.

How do I get out of this mess and onto the right track again?

Daniel Doubrovkine

unread,
Jan 3, 2014, 10:48:47 AM1/3/14
to vmwar...@googlegroups.com
You don't need VMWareComLib or VMWareComTools, just ignore them. These are COM interfaces for scripting.

The fact that you can build the C# library and samples means your own project should work as well.




--
You received this message because you are subscribed to the Google Groups "vmwaretasks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vmwaretasks...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Daniel Doubrovkine

unread,
Jan 3, 2014, 10:49:41 AM1/3/14
to vmwar...@googlegroups.com
If you do want to fix your build, you should go with an Administrator console, then do "build all /p:Configuration=Release", see where it fails. This is what we use to build the project, VS only for development. Upgrading VS I am sure brings a whole other slew of problems :)

Ver zz

unread,
Jan 4, 2014, 6:25:25 AM1/4/14
to vmwar...@googlegroups.com
Daniel,

I can generate the Interop.VixCOM.dll and get the VMWareLib, VMWareTools and VMWareLibSamples projects to build in the vmwaretasks source I cloned from git. So far so good.

But when I create a separate solution, reference the dll's created in the vmwaretasks folder and build my project, I get the same old error: Error 163 The type 'Interop.VixCOM.ISnapshot' is defined...

If I reference the Interop.VixCOM.dll, I get a whole bunch of ugly errors.

It would save me a lot of development time if I could use vmwaretasks to manage my VMs, but I just can't make this work and I don't know what is wrong.

Ver zz

unread,
Jan 4, 2014, 12:49:01 PM1/4/14
to vmwar...@googlegroups.com
I think I have finally managed to make it work!

The solution was to reference both Interop.VixCOM.dll and VMWareLib in my external project. To avoid all the ugly errors, I had to set 'Embed Interop Types' to False for Interop.VixCOM.dll (select the dll under References and change the setting in the properties window).

Thanks for your help Daniel.

Daniel Doubrovkine

unread,
Jan 4, 2014, 4:12:13 PM1/4/14
to vmwar...@googlegroups.com
Oh ... I remember the "Embed Interop Types" thing, sorry this wasted so much of your time. Can you please check whether we explicitly mention it in the docs and otherwise contribute that? 
Reply all
Reply to author
Forward
0 new messages