title: vmware .net api help vmware.vim.dll problems
body: <p>Vmware's .net api reference is somewhat confusing and hard to follow. I have been able to connect to my vcenter host then get a list of esxi hosts. Then I have been able get all the running modules on the host using <code>HostKernelModuleSystem</code>, and probe the properties on the variable "mod"... but I am not able to figure out how to get license info, I tried creating an object <code>lic</code> below, trying all different kinds of "types" from vmware with the word license in the type. but, it never works it has a problem converting the line with  <code>LicenseManagerLicenseInfo lic = ....</code> I always get the following:</p>
  
  <blockquote>
    <p>"Cannot convert type 'Vmware.Vim.Viewbase' to
    'Vmware.Vim.LicenseManagerLicenseInfo'"</p>
  </blockquote>
  
  <p>but the declaration above it for "mod" works fine.</p>
  
  <p>I have also tried:</p>
  
  <ul>
  <li>HostLicenseConnectInfo</li>
  <li>LicenseAssignmentManagerLicenseAssignment</li>
  <li>LicenseManager</li>
  </ul>
  
  <p>I am hoping someone who has worked with vmware .net api can shed some light on what i am doing wrong? I am new to C# about 1 year :) but these VMware APIs are somewhat confusing to me.</p>
  
  <pre><code>esxList = client.FindEntityViews(typeof(HostSystem), null, null, null);
  
  foreach (HostSystem host in esxList)
  {
      HostKernelModuleSystem mod = (HostKernelModuleSystem)client.GetView(host.ConfigManager.KernelModuleSystem, null);
      LicenseManagerLicenseInfo lic = (LicenseManagerLicenseInfo)client.GetView(host.ConfigManager.LicenseManager, null);
  
      string name = lic.Name;
  }
  </code></pre>