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

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
 
D

Dave Sexton

Hi,

System.Web.HttpContext.Current will return null in a non-web application.
 
H

Hans Kesting

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
 
D

Dave Sexton

Hi,

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top