| By Andreas Grabner | Article Rating: |
|
| July 24, 2009 09:30 AM EDT | Reads: |
662 |
Microsoft Developer on Ulitzer
This might be an “old hat” for most of you experienced ASP.NET Developers out there – but I think it is worth another blog entry as I just ran into the following problem:
Step 1: Migrated an Application from .NET 1.1 to .NET 2.0
I worked with an ASP.NET Application originally developed on ASP.NET 1.1. We upgraded to . NET 2.0 using Visual Studio 2008 and the project conversion wizard. Besides some problems with the conversation of project files and web service proxies – that could all be fixed manually – the conversion went smoothly. The application could be started without any problems and seemed to work fine – at least as long as we did not modify the data in the file based data store. All these transactions seemed to cause the loss of all our current ASP.NET Sessions.
Step 2: Debugging through the code
A debugging session showed us that the reason for the lost ASP.NET Sessions was an unexpected recycling of the AppDomain which led to the loss of any currently active sessions. Unfortunately we couldn’t see any reasons why the AppDomain was restarted. There were no severe exceptions nor did anybody change the web.config file on the fly (which would cause a restart).
Step 3: Reading blog entries about AppDomain Recycling
There are a number of blog entries that describe why AppDomain’s might get recycled. And some of them explained a change that happened from .NET 1.1 to .NET 2.0:
- ASP.NET Case Study: Lost session variables and appdomain recycles
- ASP.NET v2.0 – AppDomain recycles, more common than before
Step 4: Identifying our problem
So it turned out that due to the File Change Notifications on the WebRoot directory and all subdirectories AppDomains will now be recycled in case any file in this directory or subdirectory is changed/added/removed. In .NET 1.1 this was not the case – only certain files were checked for modification, e.g.: web.config.
The ASP.NET Application on our hands used a single file based database that was stored in the bin directory of our ASP.NET Application. When changes were commited to the DB and the ADO.NET driver committed those changes to the file system the File Change Notification triggered an AppDomain restart and we lost all of our current ASP.NET Sessions.
Conclusion
Be aware of this change in AppDomain recycling when migrating an older ASP.NET 1.1 Application to ASP.NET 2.0
Related posts:
- ASP.NET MVC: Hidden Performance Problem with HtmlHelper.RenderPartial functions The problem that has been discovered in this blog entry...
Read the original blog entry...
Published July 24, 2009 Reads 662
Copyright © 2009 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Andreas Grabner
Andreas has 10-years’ experience as an architect and developer, and he currently works as a senior performance architect and technology strategist for dynaTrace Software, where he influences product strategy and works closely with customers in implementing performance management solutions across the application life cycle. He is a regular speaker at software conferences, writes for a number of technology publications, and blogs at http://blog.dynatrace.com
- Kindle 2 vs Nook
- Confessions of a Ulitzer Addict
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Infrastructure-as-a-Service Will Mature in 2010: Microsoft's David Chou
- Windows 7 – Microsoft’s First Step to the Cloud
- Cloud Expo and the End of Tech Recession
- Jill Tummler Singer, Deputy CIO of CIA, Keynotes at GovIT Expo
- Reality Check at the Cloud Computing Expo
- Visual Studio 2010 Is Cloud Friendly
- Fired SCO CEO Fires Back
- Kindle 2 vs Nook
- The Difference Between Web Hosting and Cloud Computing
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Confessions of a Ulitzer Addict
- Wave on Ulitzer: Confessions of a Google Wave Fanboy
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- Cloud Computing Best Practices
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Infrastructure-as-a-Service Will Mature in 2010: Microsoft's David Chou
- Eval JavaScript in a Global Context
- Windows 7 – Microsoft’s First Step to the Cloud
- Google Maps and ASP.NET
- Crystal Reports XI & How It Has Changed
- Converting VB6 to VB.NET, Part I
- Creating Controls for.NET Compact Framework in Visual Studio 2005
- Where Are RIA Technologies Headed in 2008?
- How to Write High-Performance C# Code
- AJAX World RIA Conference & Expo Kicks Off in New York City
- Implementing Tab Navigation with ASP.NET 2.0
- i-Technology Photo Exclusive: Bill Gates & Steve Jobs In "Nerds"
- .NET Archives: Getting Reacquainted with the Father of C#
- i-Technology Viewpoint: "SOA Sucks"
- Programmatically Posting Data to ASP .NET Web Applications

























