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.
 
Back
Top