When you trying to get the user properties using following functions in SharePoint:
ServerContext serverContext = ServerContext.GetContext(site);
UserProfileManager upm = new UserProfileManager(serverContext);
UserProfile up = upm.GetUserProfile(strAccountName);

About ASPHostPortal.com
ASPHostPortal.com is Microsoft No #1 Recommended Windows and ASP.NET Spotlight Hosting Partner in United States. Microsoft presents this award to ASPHostPortal.com for ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2012, ASP.NET 4.5, ASP.NET MVC 4.0, Silverlight 5 and Visual Studio Lightswitch. Click here for more information

You will get the following error:

Steps to resolve:

  • Go to Central Administration => Application Management => Manage Service Applications => User Profile Service Application.
  • Click on Administrators => Add the user and give Full Control.
  • Click on Permissions => Add the user and give Full Control.