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

Popular posts from this blog

serialization - Convert Any type in scala to Array[Byte] and back -

matplotlib support failed in PyCharm on OSX -

python - Matplotlib: TypeError: 'AxesSubplot' object is not callable -