title: How do I determine if the executing assembly is a web app or winform/console?
body: <p>I would like to write a helper function which build the exception message to write to a log.
  The code look like:</p>
  
  <p>if(IsWebApp)<br/>
  {<br/><br/>
    &nbsp;&nbsp; &nbsp;&nbsp; use HttpContext to get the Request Path and RawUrl
  }<br/>
  else<br/>
  {<br/>
    &nbsp;&nbsp; &nbsp;&nbsp; //else it a winform/console<br/>
     &nbsp;&nbsp; &nbsp;&nbsp; Use Assembly to get executing path.<br/>
   <br/>
  }</p>