Determine if ClassLib is being run in ASP.NET

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
 
T

Tomas Restrepo \(MVP\)

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 :)
 
G

Guest

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
 

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

Top