The type or namespace UserProfileManager could not be found
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" %>
try
{
ServerContext serverCnxt = ServerContext.GetContext(Context);
UserProfileManager upManager = new UserProfileManager(serverCnxt);
UserProfile u = upManager.GetUserProfile(HttpContext.Current.User.Identity.Name);
}
Microsoft SharePointProgramming Languages-OtherASP.NET
Last Comment
passion420
8/22/2022 - Mon
Bardobrave
According to MSDN documentation Microsoft.Office.Server.UserProfiles is the correct Namespace for the class you are using.
Maybe your project has an assembly still pointing to Sharepoint 2007 that you need to change to SharePoint 2010?
Maybe your project has an assembly still pointing to Sharepoint 2007 that you need to change to SharePoint 2010?