2

I am using the Lync API within a WPF application. I have used the Office365 Lync Lab 9.1 within the training kit. However when I move the code into my WPF application the PresenceIndicator or ContactList doesn't work. The controls are displayed however the status of the Lync user is not shown. I am using the exact same accounts that are working within the Office365 Training Lab 9.1.

When I add logging I am shown errors like the following for the PresenceIndicator:

Applying template...

Control 'PresenceIndicator' entering 'OnLoaded'

UCClientInitializationFailed:Failed to Create Provider. Error Type: TypeInitializationException

I am also trying the ContactList and that is outputting:

UCClientInitializationFailed:Failed to Create Provider. Error Type: TypeInitializationException

Also the InitializationError property within the InitializationCompleted event is showing an Unknown error. How would I troubleshoot this issue further?

Luke
  • 6,195
  • 11
  • 57
  • 85

1 Answers1

1

This is a complete stab in the dark, but are you attempting to add controls to an existing WPF application that has never integrated with Lync before?

It may be that you are missing references in your app - double-check you have references to the following files in %program files%\Microsoft Lync\SDK\Assemblies\Desktop

  • Microsoft.Lync.Controls.dll
  • Microsoft.Lync.Controls.Framework.dll
  • Microsoft.Lync.Model.dll
  • Microsoft.Lync.Utilities.dll
  • Microsoft.Office.Uc.dll

Also worth checking:

  • Is your app builing against .NET Framework 3.5 or 4?
  • Are you building for AnyCPU?

If that doesn't help, you could try creating a new WPF application using the "Lync WPF Application" template in Visual Studio. If this works correctly, then compare this against your appplication for any differences in references, configuration etc.

This MSDN page may be useful.

Paul Nearney
  • 6,965
  • 2
  • 30
  • 37
  • Thanks. Yes this is an application that have never integrated with Lync. I have added those 5 references located in the Program Files (x86) and the controls do appear just they won't get the Lync status mode (i.e. Online / Offline / Be Right Back etc.). I am building for the .NET Framework 4 (Full Framework, not the Client Profile) also building for Any CPU. The link you included seems to be related to Silverlight, http://msdn.microsoft.com/en-us/library/hh378604.aspx – Luke Oct 11 '11 at 09:46
  • Thanks, I fixed the link. All I can suggest at the moment then is trying a brand new Lync WPF Application and seeing if you hit the same issues – Paul Nearney Oct 11 '11 at 09:58
  • Same problem with a new project. I know it isn't a problem with Lync as the Office365 Lab 9.1 works fine. – Luke Oct 11 '11 at 10:10
  • If the Lab works fine on your test machine, but a brand new project doesn't, then i'm truly stumped. I tried comparing all files in the 2 different projects and there don't seem to be any significant differences. Is it possible that your lab app is still running when you test the other apps, and that's causing the problem? – Paul Nearney Oct 11 '11 at 10:54
  • 5
    If I remove the reference to Microsoft.Office.Uc.dll the Lync API works. I wonder why that would occur. The Lab project has Microsoft.Office.Uc.dll as a reference and is C# and my project is VB.NET – Luke Oct 11 '11 at 10:56
  • I also experienced this problem. Removing the reference to Microsoft.Office.UC.dll solved the problem for me, as well. – David Meredith Feb 19 '14 at 18:29