How to determine running environment: desktop or web?

  • Thread starter Thread starter Don
  • Start date Start date
D

Don

I've got a DLL that needs to do different things based on whether or not the
app that's referencing it is a desktop app (e.g. typical VB.NET compiled
app) or web app (e.g. ASP.NET project running on IIS). Is there any VB.NET
method that tells you this kind of information, whether the app using the
dll at that time is a web app or desktop app?

- Don
 
One quick way that I can think of would be to check the
ExecutingDirectory directory. If it is system32 then your are must
likely in a Web application.
 

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

Back
Top