Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can access the <a href="http://msdn.microsoft.com/en-us/library/system.web.httpcontext.aspx" rel="nofollow noreferrer">Context</a> through the static <a href="http://msdn.microsoft.com/en-us/library/system.web.httpcontext.current.aspx" rel="nofollow noreferrer">HttpContext.Current</a> member.</p> <pre><code>HttpContext.Current.Request.ServerVariables["SERVER_NAME"]; HttpContext.Current.Request.Url; </code></pre> <p>Edit, Based on some of your comments I did some additional research</p> <blockquote> <p>This error is due to a design change in the IIS7 Integrated pipeline that makes the request context unavailable in Application_Start event. When using the Classic mode (the only mode when running on previous versions of IIS), the request context used to be available, even though the Application_Start event has always been intended as a global and request-agnostic event in the application lifetime. Despite this, because ASP.NET applications were always started by the first request to the app, it used to be possible to get to the request context through the static HttpContext.Current field.</p> </blockquote> <p>So you have two options</p> <ol> <li>Change your application code to not use the request context (recommended).</li> <li>Move the application to Classic mode (NOT recommended).</li> </ol> <p><a href="http://mvolo.com/iis7-integrated-mode-request-is-not-available-in-this-context-exception-in-applicationstart/" rel="nofollow noreferrer">http://mvolo.com/iis7-integrated-mode-request-is-not-available-in-this-context-exception-in-applicationstart/</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload