I'm working on a self-hosted ASP.NET web api-application.
Everything works fine, but now I'm struggling with HttpContext
:
I need to save session-informations from the client.
But HttpContext.Current
is always null.
So it's obvious that my HttpSelfHostServer
don't work with the static HttpContext-Class.
The thing I don't understand is: why..?
And I can't figure out a way to tell neither HtttpSelfHostServer
nor HttpSelfHostConfiguration
to work with HttpContext
.
Here's what I'm doing:
Creating a
HttpSelfHostConfiguration
- 1.1 Adding
Service-Resolvers
&Routes
- 1.2 Adding custom
UserNamePassword-Validator
- 1.1 Adding
create new Instance of HttpSelfHostServer with the config
- 2.1
server.OpenAsync().Wait()
- 2.1
Any help how I can tell my server to work with HttpContext.Current
is greatly appreciated!
Cheers!
AspNetCompatibility
: #5904813 – Sexagenary