I'm trying to retrieve a user's profile picture from the hidden User Information List within Silverlight. I can't use the UserProfileService.asmx because I don't have the login name nor the GUID of the user. I do have the user's ID (matching the ID field of this list) and the user's display name (as: "FirstName LastName"), because I have this data from a FieldUserValue (blog author). I have tried to rewrite this function by passing the ID, by using Linq, by calling Load() on every intermediary object (which should be unnecessary), by calling GetItemByID(int ID), by pulling the list by name (GetListByName("User Information List")) as opposed to using Web.SiteUserInfoList... and I'm stuck. None are working.

    ListItemCollection licAuthors; //<=== Global, should only return 1 user, but
                                   //     the query returns a collection anyhow
    private void GetUserLogin(string strUserName)
        ClientContext ctx = new ClientContext("http://mydevsite/");

        CamlQuery cqUserName = new CamlQuery();
        cqUserName.ViewXml = "<View><Query><Where><Eq><FieldRef Name='Title' />" +
            "<Value Type='String'>" + strUserName + "</Value></Eq></Where></Query>" +
            "<ViewFields><FieldRef Name='Title'/><FieldRef Name='Picture'/>" +

        licAuthors = ctx.Web.SiteUserInfoList.GetItems(cqUserName);

        ctx.ExecuteQueryAsync((s, e) => { getbloginfoFinished.Set(); },
            (s, e) => { getbloginfoFinished.Set(); });

Is this some kind of permissions issue because it's Silverlight? My user login has all permissions possible to access this list.

Should I be using the /_vti_bin/Lists.asmx web service?

Is pulling this information from this list going to cause permissions issues for users without full permissions?

Any help would be appreciated.

The information sources I've used thus far to try to achieve this are:




To summarize:

My end goal is to retrieve the url to a user's profile picture, given a FieldUserValue ("Created By") of a blog post, from a blog site, which is pulled from the "Posts" list.

  • Can't you just set the Created By filed to display as Named (with picture and details)? I haven't tried setting that as the option and fetching data via the web services to see what it returns, just a shot in the dark. Apr 12, 2012 at 17:39
  • Taking your advice I can see the picture in the list, yes. But how do I access the url to display the author's image in my Silverlight app on the portal landing page? Apr 12, 2012 at 18:20
  • If you try to fetch the Created By information with your Silverlight app when the field is set that way, does it return all the html with it? I know in DVWPs, the returned content is different depending on how the Created By field is formated. Apr 12, 2012 at 18:46
  • No, there's no more data. I'm still working on it. I've got it returning a user by ID... but the ID's don't match and passing my LookupId is returning the administrator account... but I'm trudging through it. Apr 12, 2012 at 18:56
  • Do you know what "Type" the value of ImnName (The user name field) is for a CamlQuery? Apr 12, 2012 at 19:07

2 Answers 2


I solved it. For posterity:

        CamlQuery cqUserName = new CamlQuery();
        foreach (ListItem liItem in oListInfo)
            FieldUserValue fuvAuthor = (FieldUserValue)liItem["Author"];
            cqUserName.ViewXml = "<View><Query><Where><Eq><FieldRef Name='ID' />" +
                "<Value Type='Integer'>" + fuvAuthor.LookupId.ToString() + "</Value>" +
                "</Eq></Where></Query><ViewFields><FieldRef Name='Picture'/>" +

        ClientContext ctx = new ClientContext(strSiteRoot + "/");
        ListItemCollection licAuthors = ctx.Web.SiteUserInfoList.GetItems(cqUserName);


        foreach (ListItem liAuthor in licAuthors)
            FieldUrlValue fuvPicture = (FieldUrlValue)liAuthor["Picture"];
            imgUri = new Uri(fuvPicture.Url);

Instead of calling:


The user ID and the internal list ID of the User Information List apparently are not the same.


The following will also work:

cqUserName.ViewXml = "<View><Query><Where><Eq><FieldRef Name='Title' />" +
            "<Value Type='Text'>" + strUserName + "</Value></Eq></Where></Query>" +
            "<ViewFields><FieldRef Name='Title'/><FieldRef Name='Picture'/>" +

The Value Type attribute should be "Text" and not "String".


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.