how to differentiate whether a managed library is running in the context of asp.net application or in a executable?
You could check whether HttpContext.Current
returns null
or not.
Technically, it'll also return null
in an ASP.NET application if it's running on a non-worker thread (i.e. if you just go new Thread(SomeProc)
) but it should work 99% of the time.