troubleshooting Question

The type or namespace UserProfileManager could not be found

Avatar of passion420
passion420 asked on
Microsoft SharePointProgramming Languages-OtherASP.NET
3 Comments1 Solution2605 ViewsLast Modified:
Hello experts
I am migrating a web app to new server that is from sharepoint 2007 to sharepoint 2010. I am getting this error below when trying to reach the webite. I have copied the ascx conrol in control templates and it is being referenced on master page which is erroring out.
The type or namespace UserProfileManager could not be found (are you missing a using directive or an assembly reference?)

Following is the code which is on the ascx control. The namepscae appears to be refered and userprofilemanager is used below. not sure why this is erroring out. Please suggest. Do I need to recompile this user control on new server or farm? Please help. Thanks for your help.

<%@ Import Namespace="Microsoft.Office.Server.UserProfiles" %>
                            ServerContext serverCnxt = ServerContext.GetContext(Context);
                            UserProfileManager upManager = new UserProfileManager(serverCnxt);
                            UserProfile u = upManager.GetUserProfile(HttpContext.Current.User.Identity.Name);

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros