<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ASP.NET Case Study: Lost session variables and appdomain recycles</title><link>http://blogs.msdn.com/b/tess/archive/2006/08/02/asp-net-case-study-lost-session-variables-and-appdomain-recycles.aspx</link><description>Last night I got a question from one of the readers of the blog that went like this: 
 
 
 “We are facing a problem that i cannot understand, every now and than i see that my app domain is recycled (i have a log in the application_end), I check the</description><dc:language>sv-SE</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: ASP.NET Case Study: Lost session variables and appdomain recycles</title><link>http://blogs.msdn.com/b/tess/archive/2006/08/02/asp-net-case-study-lost-session-variables-and-appdomain-recycles.aspx#10184819</link><pubDate>Sat, 09 Jul 2011 07:07:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10184819</guid><dc:creator>Rahul</dc:creator><description>&lt;p&gt;Very Bad to the user.It can&amp;#39;t give clear view to the user.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10184819" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET Case Study: Lost session variables and appdomain recycles</title><link>http://blogs.msdn.com/b/tess/archive/2006/08/02/asp-net-case-study-lost-session-variables-and-appdomain-recycles.aspx#10163675</link><pubDate>Thu, 12 May 2011 07:16:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10163675</guid><dc:creator>Abhijeet Dighe</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am updating style.css dynamically which is in App_Themes, whenever style.css is updated user gets logged out frequently.&lt;/p&gt;
&lt;p&gt;I think application restarts on style.css changes since it is in App_Themes folder.&lt;/p&gt;
&lt;p&gt;Is there any workaround for this issue?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10163675" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET Case Study: Lost session variables and appdomain recycles</title><link>http://blogs.msdn.com/b/tess/archive/2006/08/02/asp-net-case-study-lost-session-variables-and-appdomain-recycles.aspx#10101783</link><pubDate>Wed, 08 Dec 2010 03:34:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10101783</guid><dc:creator>Deepti</dc:creator><description>&lt;p&gt;Hi Tess&lt;/p&gt;
&lt;p&gt;Came across your blog by chance and found it amazing! Was hoping you could help us with a weird problem we&amp;#39;re encountering on our production server which has IIS6 installed.&lt;/p&gt;
&lt;p&gt;What we deal with is a simple WCF application which is hosted on default app pool in IIS. This is the only application hosted btw.&lt;/p&gt;
&lt;p&gt;Once in a while the server requests just hang up for a while, a blank period of total inactivity and at the end of the lull period activity suddenly shoots up and request completes successfully. But why this delay? There&amp;#39;s nothing in the logs in event viewer or in the logs of the application which suggests anything. The time in between is just LOST. Nothing in the dump suggested deadlocks. Can you please help me figure out the root cause? Thanks a bunch!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10101783" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET Case Study: Lost session variables and appdomain recycles</title><link>http://blogs.msdn.com/b/tess/archive/2006/08/02/asp-net-case-study-lost-session-variables-and-appdomain-recycles.aspx#9958608</link><pubDate>Fri, 05 Feb 2010 03:49:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9958608</guid><dc:creator>Bob Dickow</dc:creator><description>&lt;p&gt;Then how about the web.config &amp;lt;system.web&amp;gt;&amp;lt;hostingEnvironment idleTimeout=&amp;quot;Infinite&amp;quot; approach? The Microsoft docs suggest that this can be set in the application level web.config and will prevent application shutdown. Problem is, I tried this on a Server2003/IIS 6.0 hosting service setup and it had no effect. The result is that every few minutes the website page requests take 20 seconds or so for a page to load up as the whole site recompiles or whatever it needs to do. The config setting seems to have no effect. Would this be something that would be overridden higher up the chain?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9958608" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET Case Study: Lost session variables and appdomain recycles</title><link>http://blogs.msdn.com/b/tess/archive/2006/08/02/asp-net-case-study-lost-session-variables-and-appdomain-recycles.aspx#9936252</link><pubDate>Sun, 13 Dec 2009 15:49:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9936252</guid><dc:creator>srinivasan</dc:creator><description>&lt;p&gt;''Sec 1. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a.dll and b.dll are update to v 1.00.12 &amp;nbsp; &amp;nbsp;- appdomain unload started (any pending requests will finish before it is completely unloaded)&lt;/p&gt;
&lt;p&gt;Sec 2. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Request1 comes in and loads a new appdomain with 2 out of 7 of the dlls updated &lt;/p&gt;
&lt;p&gt;Sec 3. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; c.dll is updated &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- appdomain unload started &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (any pending requests will finish before it is completely unloaded)&lt;/p&gt;
&lt;p&gt;Sec 4. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; d.dll is updated&lt;/p&gt;
&lt;p&gt;Sec 5. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Request2 comes in and loads a new appdomain, now with 4 out of 7 dlls updated&lt;/p&gt;
&lt;p&gt;Sec 6. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.dll and f.dll is updated &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - appdomain unload started &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (any pending requests will finish before it is completely unloaded)&lt;/p&gt;
&lt;p&gt;Sec 7. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; f.dll is updated&lt;/p&gt;
&lt;p&gt;Sec 8. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Request3 comes in and loads a new appdomain with all 7 dlls updated&lt;/p&gt;
&lt;p&gt;So, many bad things happened here… &lt;/p&gt;
&lt;p&gt;First off you had 3 application domain restarts while you probably thought you would only have one, because asp.net has no way of knowing when you are done.''&lt;/p&gt;
&lt;p&gt;-----------------------------------&lt;/p&gt;
&lt;p&gt;In the above scenario, don't you feel there are more than 3 appdomain restarts, but you've stated there are 3. Am I getting this wrong ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9936252" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET Case Study: Lost session variables and appdomain recycles</title><link>http://blogs.msdn.com/b/tess/archive/2006/08/02/asp-net-case-study-lost-session-variables-and-appdomain-recycles.aspx#9933343</link><pubDate>Mon, 07 Dec 2009 10:07:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9933343</guid><dc:creator>Tess1</dc:creator><description>&lt;p&gt;unfortunately i dont think there is, but even if there was, that would mean that the updates wouldnt go through until you manually recycle. &amp;nbsp;So given that, perhaps it is better to have the content editors edit to a staging location and copy them all in one go at some point. &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9933343" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET Case Study: Lost session variables and appdomain recycles</title><link>http://blogs.msdn.com/b/tess/archive/2006/08/02/asp-net-case-study-lost-session-variables-and-appdomain-recycles.aspx#9933211</link><pubDate>Sun, 06 Dec 2009 22:15:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9933211</guid><dc:creator>frankosaurus</dc:creator><description>&lt;p&gt;Great article Tess...&lt;/p&gt;
&lt;p&gt;I have an ASP.NET application (in IIS7) where content editors make regular updates to .resx files.&lt;/p&gt;
&lt;p&gt;The problem is that this eventually causes the app domain to recycle.&lt;/p&gt;
&lt;p&gt;With changes to .aspx pages, I can set compilationMode=&amp;quot;never&amp;quot; in web.config and I avoid the problem of excess recompiles.&lt;/p&gt;
&lt;p&gt;Is there a solution for .resx files??&lt;/p&gt;
&lt;p&gt;I would prefer not to set numRecompilesBeforeAppRestart to a high value (or 0) because I don't want to use up RAM -- I need RAM for ASP.NET cache.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9933211" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET Case Study: Lost session variables and appdomain recycles</title><link>http://blogs.msdn.com/b/tess/archive/2006/08/02/asp-net-case-study-lost-session-variables-and-appdomain-recycles.aspx#9896689</link><pubDate>Fri, 18 Sep 2009 10:18:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9896689</guid><dc:creator>Tess1</dc:creator><description>&lt;p&gt;csaxena,&lt;/p&gt;
&lt;p&gt;There are basically two disadvantages. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;1. Setting numRecompilesBeforeAppRestart to something really high, as you pointed out will mean that you store more copies of stale dlls in the process leading to higher memory usage. &amp;nbsp;That is pretty much the only drawback you will see from that...&lt;/p&gt;
&lt;p&gt;2. setting maxWaitChangeNotification and waitChangeNotification to something really high like 10 hrs means that changes made during that time that require appdomain restarts wont take effect. &amp;nbsp;For example if you modify the web.config, the old settings will be &amp;quot;cached&amp;quot; in that case for 10 hrs and new ones wont take effect until the appdomain is restarted. &amp;nbsp; Same with dll updates. &amp;nbsp;As long as you are aware of that and restart the appdomain manually (by restarting the process) when changes that you need to see go through immediately are made, you'll be ok. &amp;nbsp;In general I really wouldn't recommend setting this higher than 5-10 minutes though... &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9896689" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET Case Study: Lost session variables and appdomain recycles</title><link>http://blogs.msdn.com/b/tess/archive/2006/08/02/asp-net-case-study-lost-session-variables-and-appdomain-recycles.aspx#9896548</link><pubDate>Fri, 18 Sep 2009 01:27:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9896548</guid><dc:creator>csaxena</dc:creator><description>&lt;p&gt;Great blog Tess. &amp;nbsp;I have learnt so much from it. &amp;nbsp;I have a few questions. &amp;nbsp;Is there any disadvantage of setting the value for maxWaitChangeNotification and waitChangeNotification to be really high (like 10 hours)? &amp;nbsp;We are seeing a lot of Application restarts in our DotNetNuke environment and we are not making any changes. &amp;nbsp;Is it because the different user controls on different pages are getting compiled and causing the application to be reloaded. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;What is the disadvantage (other than the memory footprint) of increasing numRecompilesBeforeAppRestart to a really high number like 500 or 1000? &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9896548" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET Case Study: Lost session variables and appdomain recycles</title><link>http://blogs.msdn.com/b/tess/archive/2006/08/02/asp-net-case-study-lost-session-variables-and-appdomain-recycles.aspx#9879163</link><pubDate>Fri, 21 Aug 2009 22:37:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9879163</guid><dc:creator>Josh</dc:creator><description>&lt;p&gt;Great article Tess! &amp;nbsp;I have been troubleshooting recycle events for a few days. &amp;nbsp;A combination of virus scanning and mis-used app pools in IIS6 were the trouble. &amp;nbsp;Thanks again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9879163" width="1" height="1"&gt;</description></item></channel></rss>