473,396 Members | 2,052 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,396 software developers and data experts.

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 16 '05 #1
4 2051
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.com> 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 16 '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.com> 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 16 '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.ApplicationPath ( 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.com> 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.com> 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 16 '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.ApplicationPath ( 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.ApplicationPath as you point out.

Thanks again for your comments and suggestions.


"Julie" <ju***@nospam.com> 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.com> 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 16 '05 #5

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

Similar topics

4
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
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...

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.