Changing file in App_Code clears session variables

  • Thread starter Thread starter E Barr
  • Start date Start date
E

E Barr

Hi,
When working in debug mode of Visual Studio 2005, whenever I make a change to one of my files in the App_Code directory, all of my session variables get cleared. This is annoying because it means I have to start the application from the beginning by re-logging in. The files in my App_Code directory are all static classes. so as far as I understand, they don't even use session variables. Does anyone know a way to keep this form happening, or is it "by design" for some reason

From http://www.developmentnow.com/g/8_2005_7_8_0_0/dotnet-framework-aspnet.h

Posted via DevelopmentNow.com Group
http://www.developmentnow.com
 
Yes, it's by design. If you make any changes to these files the app
domain will be recycled causing your session variables to clear.
 
I believe this is by design. Any time you change relevant (code related
files) files in the webapp directory, ASP.NET will recompile the
application. As a result of this, ALL sessions are closed. Any cached
variables (except ViewState) are deleted. You might be able to get
around this by saving SessionState outside of the process (like
StateServer or SQL).


Steve C.
MCAD,MCSE,MCP+I,CNE,CNA,CCNA
 
http://forums.asp.net/p/7504/7504.aspx
I believe that will answre alot of your questions.
Basically The short and simple answer is , you want any session mode except
InProc if you wish to avoid the loss of session when the app domain restarts
or the work process is recycled. StateServer is the next easiest one to use.
 
Back
Top