[ASP .NET] How to access Request data when HttpContext.Current.Request is unavailable

What happened if you need to access the HttpRequest object whitin the event Application_Start of an ASP .NET Web Application ?

Response: you end up with an exception.

Someone might observe that such event is not a valid place for a task like that, but sometimes things are simply different from those that appear at first sight.

So, if you want to get for example the virtual path or the physical path of a web application before the HttpRequest object is constructed  this is a valid solution:

HttpRuntime.AppDomainAppVirtualPath;
HttpRuntime.AppDomainAppPath;

Simply use HttpRuntime instead of HttpContext.Current.Request!

Technorati Tags: ,

354 thoughts on “[ASP .NET] How to access Request data when HttpContext.Current.Request is unavailable

  1. Pingback: canada pharmacy
  2. Pingback: fwervs.gumroad.com
  3. Pingback: buy cials online
  4. Pingback: kertyun.flazio.com
  5. Pingback: canada drug
  6. Pingback: canadian pharmacy
  7. Pingback: madridbet
  8. Pingback: meritroyalbet
  9. Pingback: meritroyalbet
  10. Pingback: eurocasino
  11. Pingback: online pharmacy
  12. Pingback: dkyubn.bizwebs.com
  13. Pingback: meritroyalbet
  14. Pingback: drugstore online
  15. Pingback: Gz92uNNH
  16. Pingback: online pharmacies
  17. Pingback: sdtyli.zombeek.cz
  18. Pingback: pharmacy canada
  19. Pingback: 1burdensome
  20. Pingback: meritking
  21. Pingback: confeitofilm
  22. Pingback: stromectol pill
  23. Pingback: buy viagra 25mg
  24. Pingback: pharmacy canada
  25. Pingback: canada medication
  26. Pingback: canadian pharmacys
  27. Pingback: stromectol price
  28. Pingback: generic stromectol
  29. Pingback: online drug store
  30. Pingback: online pharmacies
  31. Pingback: canada drug
  32. Pingback: canadian pharmacy
  33. Pingback: canada viagra
  34. Pingback: stromectol nz
  35. Pingback: buy viagra 25mg
  36. Pingback: stromectol canada
  37. Pingback: stromectol stock
  38. Pingback: canadian drug
  39. Pingback: canada pharmacies
  40. Pingback: viagra canada
  41. Pingback: buy viagra 25mg
  42. Pingback: pharmacy canada
  43. Pingback: buy viagra usa
  44. Pingback: northwestpharmacy
  45. Pingback: canada pharmacy
  46. Pingback: canadian pharmacys
  47. Pingback: buy viagra 25mg
  48. Pingback: drugs for sale
  49. Pingback: drugstore online

Comments are closed.