ServerContext serverContext = ServerContext.GetContext(site);
UserProfileManager upm = new UserProfileManager(serverContext);
UserProfile up = upm.GetUserProfile(strAccountName);
I was getting the following error.
How to resolve:
- Go to Central Administration => Application Management => Manage Service Applications => User Profile Service Application.

- Click on Administrators => Add the user and give Full Control.
- Click on Permissions => Add the user and give Full Control.

vishal kadamPosted Jan 31, 2013, 7:52 AM
No doubt that your site is one of the excellent site for IT Persons.But,plz Provide litle Explaination about Errors (i.e why this error(s) occur) also on which you give solution.. Thank you and regards...... vishal
ian GaoPosted Mar 11, 2011, 1:21 AM
Hi Anand, This error has been solved. Thanks.
ian GaoPosted Mar 10, 2011, 11:16 PM
Hi Anand, Can you help me? My english is poor. Please don't laugh at me, thanks. I create a control application for testing. Here is my code: Console.WriteLine("Start modify user profile testing..."); using (SPSite site = new SPSite("http://xxxxxx:0000")) { try { SPServiceContext context = SPServiceContext.GetContext(site); UserProfileManager upm = new UserProfileManager(context); UserProfile up = upm.GetUserProfile(string.Format("{0}\\{1}", "XXXXX", "XXXXX-XXXX")); up.DisplayName = "XXG"; up.Commit(); } catch (SoapException ex) { Console.WriteLine("Soap error: {0}.", ex.Detail.OuterXml); throw ex; } catch(Exception e) { Console.WriteLine(e.Message); } } when program run here: UserProfileManager upm = new UserProfileManager(context); I was getting the following error. No User Profile Application available to service the request. Contact your farm administrator. Another question is: "SiteSubscriptionId"(it's a property of SPServiceContext Object) value is "00000000-0000-0000-0000-000000000000", why? You can send a e-mail to "[email protected]". Please help me, thank you!