Verify if a DLL is used in ASP.NET application or Windows application

  • Thread starter Thread starter Hamed
  • Start date Start date
H

Hamed

Hello

I have a managed class library (written in C#) that is used both in ASP.NET
and Windows applications. How can I determine which platform has been called
a class method in this library.

Thanks in advance.

Hamed
 
Hi,
System.Web.HttpContext.Current will return null in a non-web
application.

True, but it will also return null if "this" call is not due to a webrequest
(for instance something run by a timer or in an extra thread)

Hans Kesting
 
Hi,

True, but then dll doesn't have to process as if it is a web application -
because it's not.
 
Back
Top