I have some WCF services that host IIS with ASP.Net support enabled.
In my web.config there is the following:
<serviceHostingEnvironment aspNetCompatibilityEnabled = "true" / ">
And my service class is decorated with the following:
[AspNetCompatibilityRequirements (RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
For some strange reason, HttpContext.Current is null for the first request after starting the web application. HttpContext.Current is not null for the following requests, as expected.
Does anyone have an idea why it is not working for the very first request?
The HttpContext.Current call is made from the user class UserNamePasswordValidator, which I wrote to verify the accounts stored in the database.
wcf
Craig quillen
source share