Lync Add-in

GoyoGoyo Member Posts: 36
edited 2012-01-28 in NAV Three Tier
Hi. I'm trying to make a Lync add-in with the PresenceIndicator control but it has been impossible. The point is i've made a windows form application with the WPF control and it works fine, but when i make the add-in exactly the same way and i open the page with Dynamics Nav, it shows the "Microsoft.Dynamcis.Nav.Client dejó de funcionar" error and Nav is closed. If i use another control, for example a Combo in the WPF UserControl instead of the PresenceIndicator Control, it works fine for Navision.

The error appears in the instantiation of the WPF UserControl:
"persona contacto = new persona();"
persona is the name of the UserControl

That's the XAML code for the UserControl:
<UserControl x:Class="AddInSamples.persona"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml&quot;
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006&quot;
xmlns:d="http://schemas.microsoft.com/expression/blend/2008&quot;
xmlns:control="clr-namespace:Microsoft.Lync.Controls;assembly=Microsoft.Lync.Controls"
mc:Ignorable="d"
d:DesignHeight="40" d:DesignWidth="132">
<Grid>
<control:PresenceIndicator Source="yo@correo.es" />
</Grid>
</UserControl>


I don't know what am i doing wrong. Why does it work in the Windows Forms application and it fails in the Add-In? Why does it work with a combo and fails with de Lync Control? I've also tried with other Lync Controls and it fails too.

Does anyone have an example that actually works with Lync Controls?

Thanks, and i'm sorry for my english.

Comments

  • kinekine Member Posts: 12,562
    I am not sure, but aren't Lync Control based on .net 4? Addins are .NET 3.5... may be the problem is there. When I try to use PresenceIndicator in my UniWPFAddin, it ends with
    The tag 'PresenceIndicator' does not exist in XML namespace 'clr-namespace:Microsoft.Lync.Controls;assembly=Microsoft.Lync.Controls'.

    Which should be because .NET versions incompatibility.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • GoyoGoyo Member Posts: 36
    Hi kine.

    I've been trying to follow the example in http://blogs.msdn.com/b/nav/archive/2011/06/17/presence-control-add-in-in-microsoft-dynamics-nav-with-lync.aspx?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+MicrosoftDynamicsNavTeamBlog+%28Microsoft+Dynamics+NAV+Team+Blog%29

    There is a video showing the funcionality working. I've tried to contact the author but i haven't get an answer so far. Any ideas on how is it done? Maybe with another components?
  • kinekine Member Posts: 12,562
    I think that the example is using OCS 2007 assembly and components, which would be .NET 3.x. You are using Lync 2010 assembly, which could be .NET 4.0.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • iceborgiceborg Member Posts: 67
    You can use the Newer (and better looking with toast for Snap pinning and everything) Lync WPF Controls from the Lync SDK.
    NAV Add-Ins have to be WinForm Controls. The Contorl in the SDK is a WPF Control.

    one way of doing it is to first to Make a WPFUserControl and drag the actual Lync WPF Control on it. Then embedd this New Control in your WinForm UserControl Form(System.Windows.Forms.UserControl) using the WPF ElementHost Container Control in the Toolbar (System.Windows.Forms.Integration.ElementHost).

    Hope it helps!
  • kinekine Member Posts: 12,562
    My UniWPFAddin is working in this way, but the result... :whistle:

    Ad if you read Goyo post, he is working in same way - WPF control hosted in WinApp...

    I am not sure, if additional enveloping the control into user control will help...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • iceborgiceborg Member Posts: 67
    It helped Me :lol:
  • kinekine Member Posts: 12,562
    Ok, than, best is to try it... :-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • henrikmhenrikm Member, Microsoft Employee Posts: 66
    When I read the requirements for the Lync SDK it says either .NET 3.5 or 4.0. As NAV 2009 R2 does not support .NET 4.0 Add-ins it is necessasy that the you have set the Add-in project to compile to .NET 3.5.

    Are your Add-in project targetting .NET 3.5?

    As stated above hosting of WPF controls must be done using an ElementHost.

    Thanks,
    /henrik
    “This posting is provided "AS IS" with no warranties, and confers no rights.”

    Henrik Metzger, Software Development Engineer, Dynamics NAV
    MSFT
Sign In or Register to comment.