473,785 Members | 2,823 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Anyone have experience w/ Application["AppState"]?

I stumbled across Application["AppState"] from someone else's code, and I can't
find out squat about by searching MS, Google, or Google Groups.

For the most part, this is returning the fully-qualified name of the server and
path to my application, such as:

http://devserver/testapp

However, on 1 of my test servers, it returns:

http://localhost/testapp

When browsing the app on the server, that isn't a problem, however if remotely
accessing it from another machine, it is still returning localhost. As
mentioned, the same application on 3 other servers behaves as expected where
the servername is appropriately substituted.

The only difference between the servers is the ones that work are running IIS 5
(XP), the one that doesn't is running IIS 4 (2k). Is there some difference
between these IIS versions that would somehow affect how Application["AppPath"]
is initialized?

Thanks
Nov 18 '05 #1
4 1152
This is an application variable that is initialized and stored for later
reuse. If you start browsing from localhost, it will record this path and it
will then be incorrect for other users browsing from outside.
Try first to see if it's ok when the application is first accessed when not
using localhost...

It is likely initialized in the global.asax file.

"Julie" <ju***@nospam.c om> a écrit dans le message de
news:40******** *******@nospam. com...
I stumbled across Application["AppState"] from someone else's code, and I can't find out squat about by searching MS, Google, or Google Groups.

For the most part, this is returning the fully-qualified name of the server and path to my application, such as:

http://devserver/testapp

However, on 1 of my test servers, it returns:

http://localhost/testapp

When browsing the app on the server, that isn't a problem, however if remotely accessing it from another machine, it is still returning localhost. As
mentioned, the same application on 3 other servers behaves as expected where the servername is appropriately substituted.

The only difference between the servers is the ones that work are running IIS 5 (XP), the one that doesn't is running IIS 4 (2k). Is there some difference between these IIS versions that would somehow affect how Application["AppPath"] is initialized?

Thanks

Nov 18 '05 #2
Patrice wrote:

This is an application variable that is initialized and stored for later
reuse. If you start browsing from localhost, it will record this path and it
will then be incorrect for other users browsing from outside.
Try first to see if it's ok when the application is first accessed when not
using localhost...

It is likely initialized in the global.asax file.
Ok, I'm making some progress. What I thought was a predefined value for
AppPath, turns out to be initialized elsewhere in the project (I had searched
the project for occurrences, but nothing showed up for this particular file).

Regardless, I've found the location of the problem, now I need to find a
solution (for the different versions of IIS?).

Thanks

"Julie" <ju***@nospam.c om> a écrit dans le message de
news:40******** *******@nospam. com...
I stumbled across Application["AppState"] from someone else's code, and I

can't
find out squat about by searching MS, Google, or Google Groups.

For the most part, this is returning the fully-qualified name of the

server and
path to my application, such as:

http://devserver/testapp

However, on 1 of my test servers, it returns:

http://localhost/testapp

When browsing the app on the server, that isn't a problem, however if

remotely
accessing it from another machine, it is still returning localhost. As
mentioned, the same application on 3 other servers behaves as expected

where
the servername is appropriately substituted.

The only difference between the servers is the ones that work are running

IIS 5
(XP), the one that doesn't is running IIS 4 (2k). Is there some

difference
between these IIS versions that would somehow affect how

Application["AppPath"]
is initialized?

Thanks

Nov 18 '05 #3
The quicker fix I see would be to change every occurence of
Application["AppPath"] with the corresponding expression used for
initializing this variable (would avoid to have a unique value regardless of
the way the website is accessed).

From a general point of view, you may or may not need the full information.
Generally Request.Applica tionPath ( that returns the root of your
application such as "/testapp") should be enough (assuming you want to keep
the same hostname and the same protocol).

Patrice

"Julie" <ju***@nospam.c om> a écrit dans le message de
news:40******** *******@nospam. com...
Patrice wrote:

This is an application variable that is initialized and stored for later
reuse. If you start browsing from localhost, it will record this path and it will then be incorrect for other users browsing from outside.
Try first to see if it's ok when the application is first accessed when not using localhost...

It is likely initialized in the global.asax file.
Ok, I'm making some progress. What I thought was a predefined value for
AppPath, turns out to be initialized elsewhere in the project (I had

searched the project for occurrences, but nothing showed up for this particular file).
Regardless, I've found the location of the problem, now I need to find a
solution (for the different versions of IIS?).

Thanks

"Julie" <ju***@nospam.c om> a écrit dans le message de
news:40******** *******@nospam. com...
I stumbled across Application["AppState"] from someone else's code, and I
can't
find out squat about by searching MS, Google, or Google Groups.

For the most part, this is returning the fully-qualified name of the

server and
path to my application, such as:

http://devserver/testapp

However, on 1 of my test servers, it returns:

http://localhost/testapp

When browsing the app on the server, that isn't a problem, however if

remotely
accessing it from another machine, it is still returning localhost.
As mentioned, the same application on 3 other servers behaves as expected

where
the servername is appropriately substituted.

The only difference between the servers is the ones that work are

running IIS 5
(XP), the one that doesn't is running IIS 4 (2k). Is there some

difference
between these IIS versions that would somehow affect how

Application["AppPath"]
is initialized?

Thanks

Nov 18 '05 #4
Patrice wrote:

The quicker fix I see would be to change every occurence of
Application["AppPath"] with the corresponding expression used for
initializing this variable (would avoid to have a unique value regardless of
the way the website is accessed).

From a general point of view, you may or may not need the full information.
Generally Request.Applica tionPath ( that returns the root of your
application such as "/testapp") should be enough (assuming you want to keep
the same hostname and the same protocol).
Yes, good comments. The original intention by the original author (which I'm
not) was to provide a way in the ASPX pages to properly define paths (to images
in this case) regardless of where the page is located in the site hierarchy,
and regardless of where the site was originally installed in the web server
hierarchy.

The entire qualified name is _not_ needed, so I may be better off using the
Request.Applica tionPath as you point out.

Thanks again for your comments and suggestions.


"Julie" <ju***@nospam.c om> a écrit dans le message de
news:40******** *******@nospam. com...
Patrice wrote:

This is an application variable that is initialized and stored for later
reuse. If you start browsing from localhost, it will record this path and it will then be incorrect for other users browsing from outside.
Try first to see if it's ok when the application is first accessed when not using localhost...

It is likely initialized in the global.asax file.


Ok, I'm making some progress. What I thought was a predefined value for
AppPath, turns out to be initialized elsewhere in the project (I had

searched
the project for occurrences, but nothing showed up for this particular

file).

Regardless, I've found the location of the problem, now I need to find a
solution (for the different versions of IIS?).

Thanks

"Julie" <ju***@nospam.c om> a écrit dans le message de
news:40******** *******@nospam. com...
> I stumbled across Application["AppState"] from someone else's code, and I can't
> find out squat about by searching MS, Google, or Google Groups.
>
> For the most part, this is returning the fully-qualified name of the
server and
> path to my application, such as:
>
> http://devserver/testapp
>
> However, on 1 of my test servers, it returns:
>
> http://localhost/testapp
>
> When browsing the app on the server, that isn't a problem, however if
remotely
> accessing it from another machine, it is still returning localhost. As > mentioned, the same application on 3 other servers behaves as expected
where
> the servername is appropriately substituted.
>
> The only difference between the servers is the ones that work are running IIS 5
> (XP), the one that doesn't is running IIS 4 (2k). Is there some
difference
> between these IIS versions that would somehow affect how
Application["AppPath"]
> is initialized?
>
> Thanks

Nov 18 '05 #5

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

Similar topics

4
2070
by: Julie | last post by:
I stumbled across Application from someone else's code, and I can't find out squat about by searching MS, Google, or Google Groups. For the most part, this is returning the fully-qualified name of the server and path to my application, such as: http://devserver/testapp However, on 1 of my test servers, it returns:
0
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10330
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10093
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9952
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8976
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7500
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3654
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.