Getting photos using API in wpf application

Dec 31, 2009 at 1:10 PM

Hi there,

Hope everything is going fine with you guys. I am facing a problem that is i want to get photos of my account and show in a window using WPF application. I am getting errors like "Could not able to deserialize" when getting the albums -- IList<album> albums = api.Photos.GetAlbums(me.uid.Value);. Please help in solving this issue.

Here is my code


                user me = api.Users.GetInfo();
                IList<album> albums = api.Photos.GetAlbums(me.uid.Value);               
                List<string> pid = new List<string>();
                int i = 1;
                foreach (album a in albums)
                    ListViewItem lvi = new ListViewItem();
                    lvi.Tag = a;
                    lvi.Name =;

                    //check for a missing album image and put generic placeholder
                    if (string.IsNullOrEmpty(a.cover_pid) || a.cover_pid == "0")
                        lvi.TabIndex = 0;
                        lvi.TabIndex = i;


                foreach (album a in albums)
                    IList<photo> photos = api.Photos.Get(me.uid.Value.ToString(),a.aid,pid);

                    foreach (photo p in photos)
                        Image img = new Image();                       
            catch { }

Thanks and Regards

Jan 1, 2010 at 11:32 AM

Could be the same issue as the one described in this thread:

Jan 2, 2010 at 4:48 PM


So in the thread given above it is mentioned that we must have current location and profile pictures. So I have added current location and profile pictures and I succeeded in getting the albums collection. 

Thanks for the help.

Now I am facing one more problem that is I am unable to get the photos now. My code is same as above. please help to solve this issue.

Thanks and Regards.