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 have a web part, hosted within a SharePoint 2007 site that has Forms Authentication enabled. During the registration process, I allow users to upload a profile image which gets stored within ASP Membership provider, but I need to add the image to the MOSS User profile as well.

After some research, I figured that this can be achieved through the MOSS UserProfile class but it can only be accessed through a server context.

I've added the requirements including Microsoft.Office.Server.dll to my application and have access to ServerContext, but regardless of how I try to access the context, it always comes back un-instantiated:

using (SPSite site = new SPSite("http://localhost:1999")
{
     ServerContext sc = ServerContext.GetContext(site);
}

I'm assuming this is because I'm running the web site through a local host instance and not a named instance?

Is there any other particular reason why the context would be null?

Edit: turns out that SSP was the issue, thanks Andreas.

share|improve this question
    
Hi Andreas, no SSP is not enabled as I'm testing this on a localized instance of SharePoint. Figured I don't need to go through the hassle. is SSP an absolute MUST? why? –  JadedEric Aug 8 '11 at 8:52
    
Can you accept @Andreas' answer? I updated it to be an answer instead of a comment. Sorry about the confusion. –  Kit Menke Aug 11 '11 at 13:37
add comment

1 Answer

up vote 1 down vote accepted

The SSP (Shared Service Provider) must installed and configured properly. You can create a new SSP through Central Administration.

share|improve this answer
    
I rephrased your answer here and added a link. Feel free to edit as you see fit. –  Kit Menke Aug 11 '11 at 13:38
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.