title: How to got vm's name,resource poll name,vlan id using c# on vmware?
body: <p>I have this code,it can show me the virtual machine's name of a vcenter:</p>
  
  <pre><code>using VMware.Vim;
  
  VimClient c = new VimClient();
  ServiceContent sc = c.Connect("hostnameOrIpHere");
  UserSession us = c.Login("usernameHere", "passwordHere");
  
  IList&lt;VMware.Vim.EntityViewBase&gt; vms = 
  c.FindEntityViews(typeof(VMware.Vim.VirtualMachine), null, null, null);
  foreach (VMware.Vim.EntityViewBase tmp in vms)
  {
    var vm=(VMware.Vim.VirtualMachine)tmp;
    Console.WriteLine(vm.name);
  }
  </code></pre>
  
  <p>I use vmware powercli 5.5.If I use 6.0,fail with this:</p>
  
  <pre><code>VimClient c = new VimClient();
  </code></pre>
  
  <p>got error can't create instance of Interface  VimClient</p>
  
  <p>I want to got name,resource pool name,vlan id of a vm.I can use vm.name or vm.Config.name to got the name of a vm,but I tried many times,can't got resource pool name and vlan id of a vm</p>
  
  <p>there is a property: vm.ResourcePool,got I got value like "ResourcePool-resgroup -409",I don't what is it.</p>
  
  <p>and I don't know how to got the vlan id</p>
  
  <p>Can you help me?Thanks!I can use other version of vmware powercli</p>