Generic COM Exception. Code is 0x80080005 when calling LyncClient.GetClient()

Answered Generic COM Exception. Code is 0x80080005 when calling LyncClient.GetClient()

  • Wednesday, April 11, 2012 12:36 PM
     
     

    Hi,

    When I call this line LyncClient.GetClient() in my IIS deployed web application, it throws the exception called "Generic COM Exception. Code is 0x80080005". 

    If I do same call in my win form application it runs fine and return back me the Lynclient object and then I can continue to send/receive some instant message to/from any contact.

    Please someone give me the solution for this if you know..

    Thanks........


    • Edited by Nehru S Wednesday, April 11, 2012 12:43 PM
    •  

All Replies

  • Wednesday, April 11, 2012 4:00 PM
     
     Proposed

    You can't use the Lync Client API in an application hosted in IIS.  The API is implemented by the Lync client running on the user's desktop.  Since your IIS hosted app does not have access to the user's desktop, it can't use this API.

    If you tell us what you are trying to accomplish. perhaps we can suggest another approach.


    Oscar Newkerk

    Oscarnew Consulting

    • Proposed As Answer by Oscarn Wednesday, April 11, 2012 4:00 PM
    •  
  • Thursday, April 12, 2012 5:36 AM
     
     

    Hi,

    Actually LyncClient.GetClient() api inturn calls the method EnsureOI(), this method inturns call the following method as,

    Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid("424BE3CD-34AB-4f51-9C57-4341166DC8FA"))), this line only throws above mentioned exception incase if you call this method from IIS web application, where as in desktop application it doesnot throw an exception.

    Same thing I tried in my IIS Web Application, that is calling the following method

    Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid("

    00024500-0000-0000-C000-000000000046"))), here the GUID mentioned is excel CLSID. This gives the Excel application object sucessfully without any exception.

     

    But, If I do call same method with different GUID that is communicator.exe CLSID "424BE3CD-34AB-4f51-9C57-431166DC8FA" throws an COMException 80080005. 

    Here my Question is when I call the Activator.CreateInstance(.....) method for excel application  gets success whereas against the Lync Com object gets COMException?.

    I may be wrong or right in this. I dont know..

    Please give me some suggestion on this.

    And also you asked me about my requirements, following are my requirements,

    In my case I have web application hosted in IIS which is listenning for some events, whenever I am receiving any one of the event I need to send Instant message to particular Lync user, and also I need to get the reply(Instant message) from that same user.

    Already I developed the windows application to do my requirement. When I try same thing in web application I am getting these problems.

    If doing my requirements in web application using Lync client object model is not possible. Let me know some other approach by which I can satisfy my requirement.

    Since I spent already enough no of days for developing this, now I dont have enough time to do it from scratch. So If possible give me source code in another approach to deliver this to my client soon.

    Quick reply is appreciated......

    Thanks....

  • Friday, April 13, 2012 1:12 AM
     
     Answered

    It sounds like you could meet your needs by writing your application using the UCMA API instead of the Lync API.  If you install the UCMA 3.0 SDK, then there is a quick start sample Place and Reply to an Instant Message Call (QuickStart)

    That does what you need.  You can find the UCMA 3.0 SDK here:  Microsoft Unified Communications Managed API 3.0 Software Development Kit


    Oscar Newkerk

    Oscarnew Consulting