Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to detect if executing under IIS

Reply
Thread Tools

How to detect if executing under IIS

 
 
Gaetan
Guest
Posts: n/a
 
      10-20-2005
I have ASP.Net code calling methods in an assembly. Those same methods can be called from
a Windows service as well.

I would like the methods to access data stored in the Application object only when running
under IIS.

Is there a quick way to detect whether the methods are running under IIS? I'm using IIS
6.0 btw.

Thanks.
 
Reply With Quote
 
 
 
 
Peter Rilling
Guest
Posts: n/a
 
      10-20-2005
When not under IIS, the HttpContext.Current would be null.

"Gaetan" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
>I have ASP.Net code calling methods in an assembly. Those same methods can
>be called from
> a Windows service as well.
>
> I would like the methods to access data stored in the Application object
> only when running
> under IIS.
>
> Is there a quick way to detect whether the methods are running under IIS?
> I'm using IIS
> 6.0 btw.
>
> Thanks.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Executing system commands in threads under Ruby 1.8.6 vhaerun vh Ruby 16 09-08-2009 10:59 AM
Deploying a web service configured under IIS 7 to one under IIS 6 Whiskey Romeo Lima ASP General 1 07-16-2009 01:05 AM
Beginner's question: executing scripts under Win XP pro Jean-Claude Garreau Python 5 03-28-2006 04:23 AM
executing c++ program under unix, unable to run the application yazwas@gmail.com C++ 1 02-22-2006 02:59 PM
Problem executing a BAT file (or EXE file) using Perl as CGI script under Apache. Tom Salzmann Perl Misc 3 07-16-2003 01:06 PM



Advertisments