473,395 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to get IIS application name?

Hi all,

Is it possible to programmatically get the IIS application
name at run time? If so, how?

A software package we bought requires some cache file
generated on the server, since we have multiple instance
of the application running on that server (pre-staging,
staging and production) so we need to configure the web to
use the correct cache folder at run time based on
application name.

here is the set up we try to accomplish:

cache file location

A.) C:/cachefolder/pre-staging
B.) C:/cachefolder/staging
C.) C:/cachefolder/production

(a config file will be located at the root of these
virtual directories)

http://myserver/pre-staging
http://myserver/staging
http://myserver/production

so at run time, how can we get the application name so
that :

if appName = "pre-staging" then map to dir A
if appName = "staging" then map to dir B
if appName = "production" then map to dir C

TIA for any help points me to the right direction is
appreciated!

Best Regards,

Sharon
Jul 19 '05 #1
1 5453
"Sharon" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
Hi all,

Is it possible to programmatically get the IIS application
name at run time? If so, how?

A software package we bought requires some cache file
generated on the server, since we have multiple instance
of the application running on that server (pre-staging,
staging and production) so we need to configure the web to
use the correct cache folder at run time based on
application name.

here is the set up we try to accomplish:

cache file location

A.) C:/cachefolder/pre-staging
B.) C:/cachefolder/staging
C.) C:/cachefolder/production

(a config file will be located at the root of these
virtual directories)

http://myserver/pre-staging
http://myserver/staging
http://myserver/production

so at run time, how can we get the application name so
that :

if appName = "pre-staging" then map to dir A
if appName = "staging" then map to dir B
if appName = "production" then map to dir C

TIA for any help points me to the right direction is
appreciated!


If you've got different paths, why not just parse out
Request.ServerVariables("URL") to figure out what script is running?

--
Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://mvp.support.microsoft.com/
http://www.microsoft.com/windowsserv...y/centers/iis/

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dennis | last post by:
Hi, I am wondering that the Application Name in Virtual Directory is compulsory be non-empty field when configuring Virtual Directory for ASP.NET application? I realized some of my ASP.NET...
10
by: florian | last post by:
Hi, we have a contention problem because of an application which tries to insert a duplicate row in a table with primary key. This insert fails of course but the locks are not released within...
4
by: Chuck | last post by:
Hello everybody, I need to abort execution during start up, while the constructor called by Application.Run is executing. If the database fails to connect during my application's startup I...
6
by: Ollie Riches | last post by:
I understand the use of Application.DoEvents() to process all outstanding messages on the message queue in a winforms application if you have long running process on the UI thread. But can anyone...
13
by: Bob Day | last post by:
Using vs2003, vb.net I start a thread, giving it a name before start. Code snippet: 'give each thread a unique name (for later identification) Trunk_Thread.Name = "Trunk_0_Thread" ' allow...
6
by: JeffDotNet | last post by:
Writing to a registered source in the Application event log I have an asp.net framework 2.0 app that I created on a winxp machine and now I am deploying it to IIS6 on a win server2003 machine. ...
12
by: Martyn Fewtrell | last post by:
Hi there I'm trying to find the correct way to write exceptions to the Application log using Vb.Net. I've done a fair bit of Googleing and although this gets plenty of mentions and that this...
2
by: Learning.Net | last post by:
hi , I have a application which reads files, directory,and its version and version information is written to text file.Its working fine if files in directory are less but problem arises when no...
3
by: John | last post by:
Hi Is there an easy way to allow user to change application settings at run time short of editing the configuration file manually? Thanks Regards
0
by: Steve | last post by:
Hello- Your assistance with this issue is greatly appreciated. Environment: - Load-balanced IIS 6.0 servers (Win2003) - web servers point (via UNC path) to a Microsoft File Cluster on...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.