2

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

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.

Looking at event viewer, I see an exception

 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()

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?

EDIT:

A combination of restarting the VM and restarting the lync client seems to fix the issue but that is the most unsatisfying solution.

KnightFox
  • 3,132
  • 4
  • 20
  • 35

1 Answers1

1

You are using the Lync Client SDK and a prerequisite for this is that the Lync Client is installed and running on that machine. https://msdn.microsoft.com/en-us/library/office/hh378549(v=office.14).aspx

As you are writing a windows service I suspect that you don't want the Lync Client present in which case you may want to the enable ui suppression mode https://msdn.microsoft.com/en-us/library/office/jj933224.aspx

If installing the Lync Client isn't an option then you may want to consider using the UCMA API which may be a better fit for a server based solution anyway https://msdn.microsoft.com/en-us/library/office/dn454984.aspx

Paul Hodgson
  • 939
  • 8
  • 15
  • 1. I have lync client installed on the machine 2. We are still developing the application so having the Lync client open is sometimes useful. In the final version i would expect to enable ui suppression. – KnightFox Jul 23 '15 at 12:56
  • 2. yes but having UI suppression makes some difference, so I'd enable it at least on the VM where you say it's failing. This may prevent issues due to an eventually missing user session (desktop). But this depends on which user account the service runs with, and if eventually service is set to allow interation with desktop – Massimo Prota Jul 23 '15 at 13:44
  • I agree with Paul Hodgson that UCMA is probably more appropriate for this scenario – Massimo Prota Jul 23 '15 at 13:46
  • Is the Lync client running and are you signed into it on the VM? Is it the 2010 client installed on the VM? – Paul Hodgson Jul 24 '15 at 10:12