title: UserProfileManager dll not building in target framwork 3.5
body: <p>I am using visual studio 2010 and trying to build a small console program to add data to users in Sharepoint 2010 using UserProfileManager.</p>
  
  <p>**using System;</p>
  
  <p>using System.Collections.Generic;</p>
  
  <p>using System.Linq;</p>
  
  <p>using System.Text;</p>
  
  <p>using Microsoft.SharePoint;</p>
  
  <p><em>using Microsoft.Office.Server.UserProfiles;</em></p>
  
  <p>using System.DirectoryServices.AccountManagement;</p>
  
  <p>using System.IO;**</p>
  
  <p>The problem I am getting is trying to build this.
  If my target framework is 4.0 it builds fine, but hence does not run on the server where sharepoint is deployed:</p>
  
  <p>*Unhandled Exception: System.PlatformNotSupportedException: Microsoft SharePoint
  is not supported with version 4.0.30319.269 of the Microsoft .Net Runtime.
     at Microsoft.SharePoint.Administration.SPConfigurationDatabase.get_Farm()
     at Microsoft.SharePoint.Administration.SPFarm.FindLocal(SPFarm&amp; farm, Boolean
  &amp; isJoined)
     at Microsoft.SharePoint.SPSite..ctor(String requestUrl)
     at AddRandomMindtags.Program.Main(String[] args)*</p>
  
  <p>When the target framework is set to 3.5 it gets the following build error:</p>
  
  <p>*The type or namespace name 'Office' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)</p>
  
  <p>The type or namespace UserProfileManager could not be found...*</p>
  
  <p>Anyone any idea what the problem might be?</p>
  
  <p>Many thanks :)</p>