Bassie
Bassie

Reputation: 10390

Can't find PeopleManager and SiteUserInfoList not returning all users

I want to use PeopleManager but for some reason I don't have it. I just get

CS0246 The type or namespace name 'PeopleManager' could not be found (are you missing a using directive or an assembly reference?)

I am using Microsoft.SharePoint.Client and Microsoft.SharePoint.Client.RunTime V4.0.30319

Why can't I get the people manager?

I am currently getting all users with this code:

var web = clientContext.Web;
var list = clientContext.Web.SiteUserInfoList;
var users = list.GetItems(new CamlQuery());
clientContext.Load(users, includes => includes.Include(
    f => f["GUID"],
    f => f["FirstName"],
    f => f["LastName"],
    f => f["UserName"],
    f => f.DisplayName));

try
{
    clientContext.ExecuteQuery();
}
catch (Exception e)
{
    Trace.TraceError(e.Message);
    Trace.TraceError(e.StackTrace);
    throw;
}

but there are some users missing. Appreciate any help.

Upvotes: 0

Views: 317

Answers (1)

Jaime Macias
Jaime Macias

Reputation: 847

You probably figured this out by now, but you have to include SharePoint.Client.UserProfiles in your using directives.

If you don't have it available download the NuGet Package.

Upvotes: 1

Related Questions