asp.net web api - How to access HttpContext.Current.Application on OWIN Startup -
i need fill httpcontext.current.application["translations"] on owin startup, httpcontext.current null there.
should use application_start() in global.asax.cs or bad idea?
what alternatives have?
httpcontext not available @ start cannot exist without request. startup class runs once application, not each request.
try accessing in beginrequest handler in global.asax.cs.
protected void application_beginrequest(object sender, eventargs e) { base.application["translations"] = "my value here"; }
Comments
Post a Comment