title: LyncClientException when trying to run Windows service
body: <p>I have a Windows service that uses the Microsoft Lync 2010 SDK. When I run the service locally, everything seems to be running as expected. When I try deploying the code to a VM, when I try starting a service, it errors out saying </p>
  
  <pre><code>The Foo service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.
  </code></pre>
  
  <p>Looking at event viewer, I see an exception </p>
  
  <pre><code> Service cannot be started. Microsoft.Lync.Model.LyncClientException: Generic COM Exception. Code is 0x80080005.
     at Microsoft.Lync.Model.LyncClient.EnsureOI()
     at Microsoft.Lync.Model.LyncClient.GetClient()
  </code></pre>
  
  <p>I tried installing Visual studio and the windows lync 2010 SDK on the VM but that did not fix the problem either. Is there anything else I should be trying?</p>
  
  <p>EDIT:</p>
  
  <p>A combination of restarting the VM and restarting the lync client seems to fix the issue but that is the most unsatisfying solution. </p>