473,797 Members | 2,893 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is the lifetime of an Application state?

I'm storing some things in the application state, like this:
Application["MyValue"] = "whatever";

In Visual Studio, when I shut down the web app then start it again the
application state information remains. If there are no browsers using
the app one would think that this would remove any application state,
but it does not.

However if I wait awhile then the application state information goes
away.

What controls the length of its life?

Thanks for your help.
Nov 18 '05 #1
1 1365
The behavior you are seeing is somewhat skewed by the debugger. Its altered
to mimic the real world behavior as much as possible. An application is
recycled when, among other things, files are touched in the directory.
Closing visual studio does not touch the files so the application state
remains. However if you save before closing that will trigger a restart of
the app. This closely mimics real world behavior which cause an app to
restart if the config files are dirty, the number of uploaded files exceed
15, the assembly files change, idle time out etc etc.
Makes sense?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Bruce W.1" <no@direct.emai l> wrote in message
news:40******** ******@direct.e mail...
I'm storing some things in the application state, like this:
Application["MyValue"] = "whatever";

In Visual Studio, when I shut down the web app then start it again the
application state information remains. If there are no browsers using
the app one would think that this would remove any application state,
but it does not.

However if I wait awhile then the application state information goes
away.

What controls the length of its life?

Thanks for your help.

Nov 18 '05 #2

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

Similar topics

14
3169
by: MuZZy | last post by:
Hi, Lately i've been (and still am) fixing some memory leaks problems in the project i just took over when i got this new job. Among the other issues i've noticed that for localy created objects it makes difference to explicitly put them to null after working with them is done - it somehow makes the GC collect them sooner, like here: void SomeFunc() { MyClass c = new MyClass();
6
1508
by: Richard Steele | last post by:
I have a static object that gets referenced at application startup. This object stores a dataset and various strings to be used whenever required. This object may be called at anytime to provide the data and strings, but can be waiting for any length of time period i.e 24hours (this is not a webapp, but a kiosk winform). 99% of the time, the object is available and when required provides its information. the 1% of the time, I get a null...
11
1733
by: Trapulo | last post by:
I've a question about globa variables lifetime in an asp.net app. I've declared this class: Public Class Utils Private Shared _FcdDataManagement As FCD.DataManagement Public Shared ReadOnly Property FcdDataManagement() As FCD.DataManagement Get
16
2904
by: anonymous.user0 | last post by:
The way I understand it, if I have an object Listener that has registered as a listener for some event Event that's produced by an object Emitter, as long as Emitter is still allocated Listener will stay alive. Is this correct? If this is correct, I've got a problem. Let's say I've got an object Customer that has an PurchaseList (Collection) of Purchase objects. Now, these Purchase objects were pulled from a datasource Datasource. The...
2
1815
by: xzzy | last post by:
Using ASP.net, C# and a static class, does the following from MSDN mean: 1. a static hashtable would only live during the session and end when the session ends 2. there would be a different static hashtable for each session ++ from MSDN ++
0
1276
by: Kürþat | last post by:
Hi all, I want to host a remote object in a windows service. This remote object fires events about service state. Clients connect and consume this events. The service configures and marshal remote object in its constructor. When a client application starts it connects remote object, registers events and monitors service state. So far so good. When service stops, it fires stop event via remote object and all clients know the service was...
3
1843
by: garyusenet | last post by:
In a book i'm reading i've just ventured into chapter 3 - C# language fundamentals. Now i can see that the first part of the code after the class definition defines a public variable, of type string, called userMessage. But I don't understand the term 'point of state data' can someone clarify that for me please. TIA. Gary- I've just encountered the following sample code: -
3
7161
by: Ing. Davide Piras | last post by:
Hi there, in my c# .NET 2.0 application I run few threads (from 6 to 12 it depends...) and then my GUI Thread should wait all of them have finished their task... so after create those threads i put them in a List<>, I start them one by one then I do something like: List<ThreadElencoThreadTabelle = new List<Thread>(); ....
66
3381
by: John | last post by:
Hi What are the advantages actually achieved of managed code? I am not talking of theory but in reality. Thanks Regards
0
10468
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
10205
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
10021
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
9063
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
7559
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
6802
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
5458
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4131
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.