Wednesday, 17 February 2010

WCF

When hosting a WCF service in an Asp.Net application it is possible to get to the
HttpContext.Current to access the User.Identity.Name as follows:
1. Add serviceHostingEnvironment aspNetCompatibilityEnabled="true" to the web.config

2. Add [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
to the service implementation.

No comments:

Post a Comment