Determine if ClassLib is being run in ASP.NET

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I determine in code if a class library dll is being run in
ASP.NET/IIS as opposed to a WinForms application?

Thanks
-Bill
 
Hi Bill,
How can I determine in code if a class library dll is being run in
ASP.NET/IIS as opposed to a WinForms application?

You could query for HttpContext.Current. That said, Why do you care? Sounds
like the kind of thing that could be better served by a little refactoring.

I say this because it is not very clear what you aim to. If someone puts
your component in a COM+ Server application being called from ASP.NET.... is
ti "running in ASP.NET/IIS" under your definition? That's just an example :)
 
Thanks for your response. I'll give that a shot. The purpose of this is to
license our component properly. We will have different licensing depending
on if the component is being used in a WinForms application versus a server.
In your example of placing the component in a COM+ server running from
ASP.NET, I would hope to also consider this a server installation.

Regards,
-Bill
 
Back
Top