views:

37

answers:

1

ASP.NET profile properties are trivially available to the code-behind of an ASPX web page courtesy of the HttpContext.Current.Profile object.

In a .svc web service, how does one bring ProfileCommon and paraphernalia into scope?

+1  A: 

In the web.config file is a commented out section controlling whether the profile service is enabled. Enabling it changes the generated code and HttpContext becomes available.

You don't have the class that descends from ProfileBase to present profile properties as strongly typed properties. This however is hardly a disaster, you just use

  HttpContext.Current.Profile.GetPropertyValue(string propName)

and cast the result.

Peter Wone