Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loss of session state when adding files to website 2

Status
Not open for further replies.

MarkXaml

Programmer
Oct 19, 2007
58
US
I'm still somewhat new to ASP.NET development and could use some help. On the website, I am storing a "loggedin" flag in a session variable that is checked in the masterpage and redirects to the login page if necessary. Whenever I upload new or modified pages or classes to the site, it boots everyone that is using it. I'm assuming it has to do with the fact that the site needs to recompile. I am not using a precompiled website.

What are the best practices for handling this? Or is this just how it works? Should something besides a session variable be used? Too many people use the site to inform them that it will be "reset" at a certain time.

Our architect is currently comprising a schema using the CSLA framework principals, etc, but it won't be ready for months. I'm also not convinced that it won't suffer the same effects, but we'll see.

We're just looking for something to get us by for now. Any pointers would be greatly appreciated.

Thanks!
Mark
 
when you update a file on the root of website, a web.config in any directory, modify the bin directory or modify more than ~12 files the site will reset.

hear are some guidelines I would use for production deployments:
1. notify the users ahead of time about system maintenance. email and a notice on the website.
2. pick a standard off-hours period for maintenance. 2 am Sunday morning. 1st Saturday morning of the month. etc.
3. force a static page stating the maintenance is happening durning this time period. if someone visits the site they will get this static page. most likely this requires some IIS configuration to force any request to the static content.
4. update the site
5. remove the static page to allow users back into the site.

I believe this could be automated with build/deploy scripts.
build tools include:
team city (CI server, but may have extension points)
nant
psake
rake

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Thanks, guys! I guess it's not like classic asp, eh??

It looks like this will be more of a culture shift for management than us coders. They are used to us doing something 'real quick' and making it live.

I appreciate the info and the link. I'll use it to formulate an update procedure with the team and present it to mgmt. We can then laugh at their response on lunch!

Mark
 
This is actually known as AppDomain Recycling and can happen when you update pretty much any file. I found this out on one of our reporting sites that dropped reports into one of the websites directories and it caused havoc! To get around it, I created a second virtual directory for the reports to be dropped into and pointed the application to look there instead which solved the problem.

If you are doing something similar, but for some reason can't add another directory, a potential workaround would be to disable File Change Notifications (FCNs) on that server:


However, the downside to that is you have to manually restart the application if you make any changes to the web.config file otherwise the AppDomain won't get recycled. Plus, if you have any other applications on the same server the same issue will manifest itself to them.


Mark,

Darlington Web Design
Experts, Information, Ideas & Knowledge
ASP.NET Tips & Tricks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top