Hi, how to differentiate whether a managed library is running in the context of asp.net application or in a executable?
Thanks in adv
Hi, how to differentiate whether a managed library is running in the context of asp.net application or in a executable?
Thanks in adv
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.
This question doesn't really make a lot of sense. A process is a process. But you may be able to tell if your library is loaded by ASP.NET by checking to see if HttpContext.Current is null.