VMware Cloud Community
CapKirk
Contributor
Contributor
Jump to solution

Can't access vSphere objects via .NET

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

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Did you install PowerCLI ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
5 Replies
LucD
Leadership
Leadership
Jump to solution

That DLL is normally installed in %windir%\assembly


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

CapKirk
Contributor
Contributor
Jump to solution

I'm looking in C:\Windows\assembly but it's not there.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Did you install PowerCLI ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
CapKirk
Contributor
Contributor
Jump to solution

No, but I did after seeing your post. I found the DLL and got past the error, thank you.

0 Kudos
Firewolf1337
Contributor
Contributor
Jump to solution

Is there any way to run the application without installing PowerCLI?

0 Kudos