“No User Profile Application Available” Mystery in SharePoint 2010

Here’s another in what seems like a growing list of permissions gotchas in SharePoint 2010.  Assume if you will, you are a crack developer and building a custom application for SharePoint 2010.  You’re writing code on your development server, which has a FULLY functioning installation of SharePoint 2010.  You want to work with some user profile data, so you create an instance of the UserProfileConfigManager.  Strangely, when you do this you get an exception that says “No User Profile Application available to service the request. Contact your farm administrator.”

Hmm, seems strange.  You double check your settings, your user profile service application is up and running.  You’re probably a farm admin even in this scenario and you are able to manage it – so what is the scoop?  You may think, ah, I need to grant myself rights to manage the application.  We’ve seen that behavior in another posting I published just today on working with FAST user contexts.  So you find your user profile service app, click on the Administrators button in the ribbon and give your self Full Control rights to it.  You try again – same problem.  Grrr!  Yes, this can get frustrating.  As it turns out, there is yet another place where you may need to set permissions, and this is one of those cases.  If you look in the ribbon when you select a service application, you will see the Administrators button, but there is also the Permissions button on the far right.  In this case, click the Permissions button.  Add your account and give it Full Control rights.  NOW, go back and try your code again – this time it should work.

Sorry, I wanted to add one other scenario I have seen happen.  Many times you create the ServiceContext for getting the UserProfileManager by getting a reference to an SPSite and then using the SPServiceContext.GetContext method.  What I have seen happen before is that if that site that you create the SPSite reference to allows anonymous access, you may still get this error.  When disabling anonymous access at the site collection level it started working.  Just another FYI.

One thought on ““No User Profile Application Available” Mystery in SharePoint 2010

  1. Hello, very helpful info. Even though I’m using 2013, I followed all these links and suggestions and still kept running into an access denied error. I finally tracked down the actual Photo Library for user profile photos, in my case: http://PORTAL/my/User Photos/Profile/Pictures. Under Site Settings/Permissions I had to add the Profile Sync Managed account to the Site Collection Administrators and Bingo! A silly thing that I probably missed somewhere along the way but was the solution to 3 days of epic battles!

    Thanks for you post!

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s