Last post Jan 17, 2011 11:43 PM by LLahman
Jan 17, 2011 06:19 PM|LLahman|LINK
I am running Windows7 Ultimate (64-bit), VS2010, and .NET 4.0.
I have an application variable (called "UserCount" for example). The field is incremented/decremented at session start and session end. In reality, the concept is a little more complicated than this, but this example will work just fine.
The Application_Start event in the gloabl.asax contains a line of code to set this counter to zero (0).
Right now (during development) I am displaying the value of this variable on the default.aspx page.
As I run through various tests, quitting testing, changing lines of code, rerunning tests, quitting, etc. the number displayed keeps going up.
If I change lines of code in any code-behind files, then the number resets.
You probably think I am really stupid, but I was under the impression that the application start event would execute each time I ran a test through Visual Studio.
Is the behavior that I am seeing correct? Is there anything I do to "force" a restart of the application? Restarting IIS doesn't seem to do it.
Thanks in advance!
Jan 17, 2011 06:49 PM|Segundo|LINK
perhaps you are using the Visual Studio DEvelopment Server, then you must close it before to start again...
check if the system tray shows name: "ASP.NET Development Server"... close it... it will reset all variables
Any doubt, post your comment.
Jan 17, 2011 11:43 PM|LLahman|LINK
Thank you! You would think after all the time I have spent doing this that I would have known that. It worked great! Actually, that's a pretty good feature.