Quantcast
Channel: Microsoft Unified Communications Managed API SDK forum
Viewing all articles
Browse latest Browse all 889

Debugger error message for GetContactInformation(ContactInformationType.Photo)

$
0
0

Hi,

i am searching for the solution for hours, but found nothing...

i can retrieve the users and all the data, and want to use the photo too.

There is no problem with those user who have photo, but for those who doesnt i see an error in the debugger window. my code works fine and sets the "nophoto" picture fine, but cleaning my code i wanted to handle that message... as i see i get that because the IF(), but i need to use that. what can i do?

                    try
                     {
                         if (contact.GetContactInformation(ContactInformationType.Photo) != null)
                         {
                             var imageSource = new BitmapImage();
                             imageSource.BeginInit();
                             imageSource.StreamSource = (Stream)contact.GetContactInformation(ContactInformationType.Photo);
                             imageSource.EndInit();
                             MyContact.LyncImage = imageSource;
                         }
                     }
                     catch(Exception)
                     {
                         var imageSource = new BitmapImage();
                         imageSource.BeginInit();
                         imageSource.UriSource = new Uri("pack://application:,,,/Test;component/Images/Lync/LyncAvatar.png");
                         imageSource.EndInit();
                         MyContact.LyncImage = imageSource;
                     }

The error i get in the debugger/output window:

A first chance exception of type 'System.InvalidOperationException' occurred in PresentationCore.dll


Viewing all articles
Browse latest Browse all 889

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>