Sharepoint keep user information in a separated list therefore in some site if user never enter the site, this list does not contain user info.

if you’re attempting to write code that iterates thru a group of usersĀ  that code will fail for any user who has not logged into the SharePoint site and throw the ‘User Cannot Be Found’ exception.

Solution:



SPUser usr=SPContext.Current.Web.Users[PeopleEditor1.CommaSeparatedAccounts];

//instead use following code

SPUser usr = SPContext.Current.Web.EnsureUser(PeopleEditor1.CommaSeparatedAccounts);