简体   繁体   中英

Is there a C# wrapper for the VMware VIX API?

I am using VMware Workstation 6.5 on Windows Vista x64. I would like to automate some of the VM management tasks. I know that there is a COM API ( http://www.vmware.com/support/developer/vix-api/ ) available which I could use directly.

Is there a C# wrapper for this COM API?

Thanks,

Arnie

现在有一个很好的库可以解决这个问题: http//www.codeproject.com/KB/library/VMWareTasks.aspx

VMWareTasks是VixCOM的完整包装器: http ://vmwaretasks.codeplex.com

ArnieZ.

Any COM DLL can be used from .NET. Adding it as reference in visual studio will generate a DLL called

"YourDll.Interop.dll"

This is a .NET -> COM marshaling library, and will do what you need.

You can also generate this from the command line using tlbimp.exe

Of course, you'll have to keep in mind that you are invoking COM components, and remember to use the .NET Marshaling API to decrease reference counts when you are done using them, otherwise you will cause memory leaks.

I've wrapped the interop implementation in another library that implements IDisposable on its objects so that cleanup is handled automatically before, but if it is a large library, this might not be worth the effort.

How 'bout adding a reference to this API in your VS.Net and let VS.Net create a managed wrapper for you? I'm not aware of any "managed" API for this. Let me know if you find it :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM