Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm following the instructions at How to: Create and Edit a User Profile Property. I keep getting a NullReferenceException on the call to the UserProfileConfigManager constructor. The context variable is not null, so I'm not sure where to begin trying to solve the problem. Any ideas?

The context variable doesn't have a lot to look at, but its SiteSubscriptionId property is GUID of all zeros.

The stack trace before is as follows:

   at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_ApplicationProperties()
   at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_ILMMachineName()
   at Microsoft.Office.Server.UserProfiles.UserProfileConfigManager.Initialize(UserProfileApplicationProxy userProfileApplicationProxy, Guid partitionID)
   at Microsoft.Office.Server.UserProfiles.UserProfileConfigManager..ctor(SPServiceContext serviceContext)
   at UserProfilesOMApp.Program.Main(String[] args) in C:\path\to\Program.cs:line 14
share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Have you granted the account running your custom application with Administrative permission and Full Control Permission to the UPA?

share|improve this answer
    
Thanks for the reply, Trevor. I just tried that (Manage Service Applications: User Profile Service Application: Administrators, and added myself), and I'm still getting the same exception. –  Don 01001100 Jan 5 '12 at 19:53
    
You also need to click on Permissions and provide yourself Full Control. –  Trevor Seward Jan 6 '12 at 20:07
    
Thanks, Trevor. That was it! Sorry for the late reply! –  Don 01001100 Jan 12 '12 at 13:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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