title: Access asp.net membership profile values from a different application scope
body: <p>I have a solution which includes a website and WCF web service.  Within the website I need to get the current logged on user and access a property value in their profile which specifies the username of another user (used for web service).  I then need to get a property from the web service user profile (not the logged on web site user!).</p>
  
  <p>So far I have this :</p>
  
  <pre><code>if (HttpContext.Current != null)
          {
              if (!string.IsNullOrEmpty(HttpContext.Current.Profile.UserName))
              {
                  serviceUsername = HttpContext.Current.Profile.GetPropertyValue("WSUserName").ToString();
  
                  if (!string.IsNullOrEmpty(serviceUsername))
                  {
                        ProfileBase profile = ProfileBase.Create(serviceUsername);
                        var siteId = profile.GetPropertyValue("SiteID");
                  }
              }
          }
  </code></pre>
  
  <p>Which almost works, I can get the web service user profile by name but I can see the {ProfileCommon} is showing the properties of the web application instead of the web service so I am unable to see the value I need.</p>
  
  <p>Any advice on how I might be able to achieve this?</p>