I have some WCF services that are hosted by IIS with ASP.Net compatibility turned on.
I have the following in my web.config:
< serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
And my service class is decorated with the following:
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
For some weird reason, the HttpContext.Current is null for the first request after the web app starts up. The HttpContext.Current is not null for following requests as expected.
Does anyone have an idea why it isn't working for the very first request?
The call to HttpContext.Current is from within a custom UserNamePasswordValidator class I wrote to check creds stored in the database.