Greetings experts,
I am writing a .NET 4.5 application to access and manage vSphere objects. As a first step, I'm creating a simple prototype to make a list of all the VMs that are powered on.
I downloaded vSphere PowerCLI, set a reference to VMWare.Vim and wrote this code:
Imports VMware.Vim
...
Dim client As New VimClientImpl
client.Connect(serviceURL)
client.Login(userName, password)
Dim filter As NameValueCollection = New NameValueCollection
filter.Add("Runtime.PowerState", "PoweredOn")
Dim VMsList As IList = client.FindEntityViews(GetType(VirtualMachine), Nothing, filter, Nothing)
Dim losVMs As New List(Of String)
For Each VM As VirtualMachine In VMsList
losVMs.Add(VM.Name)
Next
I'm getting this exception on the client.Connect line:
An exception of type 'System.IO.FileNotFoundException' occurred in VMware.Vim.dll but was not handled in user code
Additional information: Could not load file or assembly 'VimService55, Version=5.5.0.0, Culture=neutral, PublicKeyToken=10980b081e887e9f' or one of its dependencies. The system cannot find the file specified
It seems to be missing VimService55.dll but for the life of me I cannot find this DLL anywhere online or in the VMWare SDK for .NET Developers download package (VMware-vSphere-SDK-5.5.0-1284541). Can anyone please help?
TIA,
Rob
Did you install PowerCLI ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
That DLL is normally installed in %windir%\assembly
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I'm looking in C:\Windows\assembly but it's not there.
Did you install PowerCLI ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
No, but I did after seeing your post. I found the DLL and got past the error, thank you.
Is there any way to run the application without installing PowerCLI?