title: Web or console app, how to get the application context of the current DLL
body: <p>I have a general c# Tools DLL which is being used both in  a console library and also in a web application.  Depending on whether the DLL is being used in a web application or in the console I need certain methods to execute differently.  </p>
  
  <p>Is there a way to determine if we are in a web context or console application context from within a given method?  I realize that I could use a config file to achieve this, but in my situation it would be preferable if I could accomplish this in the method.</p>