<?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>Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx</link><description>The default stack size of IIS starting with Windows Server 2003 was changed.&amp;#160; Prior to 2003, it was set to 1 MB.&amp;#160; This is also true of the aspnet_wp.exe process that Windows 2000 uses. In 2003 and later, it is now set to 256 KB. This can cause</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8345949</link><pubDate>Mon, 31 Mar 2008 20:25:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8345949</guid><dc:creator>DotNetKicks.com</dc:creator><description>&lt;p&gt;You've been kicked (a good thing) - Trackback from DotNetKicks.com&lt;/p&gt;
</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8345955</link><pubDate>Mon, 31 Mar 2008 20:29:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8345955</guid><dc:creator>Tom</dc:creator><description>&lt;p&gt;One additional note, if you are creating your own thread, and it is a native thread, you can use the CreateThread API and pass it a stack size, but since this doesn't work work .NET, I didn't want to include it in the main post. &amp;nbsp;This is talked about here:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://msdn2.microsoft.com/en-us/library/ms686774.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms686774.aspx&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8345978</link><pubDate>Mon, 31 Mar 2008 20:43:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8345978</guid><dc:creator>Eber Irigoyen</dc:creator><description>&lt;p&gt;so you just execute this one time and you're good to go?&lt;/p&gt;</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8345993</link><pubDate>Mon, 31 Mar 2008 20:50:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8345993</guid><dc:creator>Tom</dc:creator><description>&lt;p&gt;yes, once you run this command, it will change the exe and it will always run that way. &amp;nbsp;Until you install an update, like the next Service Pack. &amp;nbsp;That will put down a fresh exe and so it will set it to whatever Microsoft has set it to.&lt;/p&gt;
</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8346032</link><pubDate>Mon, 31 Mar 2008 21:03:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8346032</guid><dc:creator>molotov</dc:creator><description>&lt;p&gt;It may be worth mentioning that the modification to the binary / EXE will render it &amp;quot;unverifiable&amp;quot; - it would seem that tools like Sigcheck and Process Explorer would be unable to verify the module...&lt;/p&gt;</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8346089</link><pubDate>Mon, 31 Mar 2008 21:32:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8346089</guid><dc:creator>Tom</dc:creator><description>&lt;p&gt;Molotov, that is a very good point. &amp;nbsp;Since you would be modifying the original file so anything that checks it would say the file has changed.&lt;/p&gt;
</description></item><item><title>IIS Stack in Windows Server 2003+</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8346241</link><pubDate>Mon, 31 Mar 2008 22:24:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8346241</guid><dc:creator>Jason N. Gaylord's Blog</dc:creator><description>&lt;p&gt;Apparently the IIS stack has changed in Server 2003. I've never noticed any issues with my ASP.NET apps&lt;/p&gt;
</description></item><item><title>IIS Stack in Windows Server 2003+</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8346357</link><pubDate>Mon, 31 Mar 2008 23:01:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8346357</guid><dc:creator>Jason N. Gaylord's Blog</dc:creator><description>&lt;p&gt;Apparently the IIS stack has changed in Server 2003. I&amp;amp;#39;ve never noticed any issues with my ASP.NET&lt;/p&gt;
</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8346864</link><pubDate>Tue, 01 Apr 2008 02:33:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8346864</guid><dc:creator>Josh Coswell</dc:creator><description>&lt;p&gt;This stack problem is new to me.&lt;/p&gt;
&lt;p&gt;Josh&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://riverasp.net"&gt;http://riverasp.net&lt;/a&gt;&lt;/p&gt;</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8347967</link><pubDate>Tue, 01 Apr 2008 15:20:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8347967</guid><dc:creator>Michael Reyeros</dc:creator><description>&lt;P&gt;Good morning, our team recently faced this issue with the Stack Size restriction in Windows 2003, and newer OSes for that matter. &amp;nbsp;Our ASP.net application generates very large pdf files and what we were experiencing was that on XP, which still had the 1mb stack size, all was well. &amp;nbsp;Once we move the code to production, a Windows Server 2003 box, we started seeing that the application would crash. &amp;nbsp;We checked the Application event log and noticed that we were receiving an error on the w3wp.exe worker process service. &amp;nbsp;The way that we resolved this issue was to create a seperate thread joined to the current thread of the application and call our generate pdf method from this thread. &amp;nbsp;Here is some code for all that may need it for future reference:&lt;/P&gt;
&lt;P&gt;protected void Button1_Click(object sender, EventArgs e)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Thread t = new Thread(GenerateCertificates, 4194304);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;t.Priority = ThreadPriority.Lowest;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;t.Name = "BatchCertificateThread";&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;t.Start();&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;t.Join();&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;}&lt;/P&gt;
&lt;P&gt;Basically the new Thread() constructor accepts a delegate as well as a maxStackSize parameter here is where you can set the StackSize for this new thread. &amp;nbsp;In the code above I have set it to 4mb since sometimes the pdfs that we are generating can grow to well over 1000 pages.&lt;/P&gt;
&lt;P&gt;I hope that this information will be useful to anyone experiencing this issue.&lt;/P&gt;</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8347999</link><pubDate>Tue, 01 Apr 2008 15:39:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8347999</guid><dc:creator>Tom</dc:creator><description>&lt;p&gt;Thanks Michael, that is another useful workaround that will allow you to keep the stack size the default. &amp;nbsp;You just have to be careful that you watch your thread count as this will create an extra thread for each request to this page. &amp;nbsp;You may need to raise your threadpool settings to accomidate the additional threads.&lt;/p&gt;
</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8348256</link><pubDate>Tue, 01 Apr 2008 18:20:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8348256</guid><dc:creator>ML</dc:creator><description>&lt;p&gt;Just wanted to add a small comment here about this approach of creating you own thread as opposed to using editbin.&lt;/p&gt;
&lt;p&gt;The approach of creating your own thread and set a specific size limit to workaround &amp;nbsp;the .net stack size limitlation under IIS6 seems to be much more better since you don't have to keep track of new updates that may change w3wp.exe and on the other hand it addresses just specific threads that you would need them to have larger size instead of all threads within w3wp.exe.&lt;/p&gt;
&lt;p&gt;I debugged this yesterday and it seems that even if you set a size limit of 4 MB (Thread t = new Thread(GenerateCertificates, 4194304);), the thread is created first with a size of 8k and continues growing anytime more space is needed until it reaches the specified limit. So no worries of using the whole 4 MB at thread start :)&lt;/p&gt;</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8348630</link><pubDate>Tue, 01 Apr 2008 21:33:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8348630</guid><dc:creator>Eber Irigoyen</dc:creator><description>&lt;p&gt;how do you change that file without Windows File Protection restoring it back?&lt;/p&gt;</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8348671</link><pubDate>Tue, 01 Apr 2008 21:57:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8348671</guid><dc:creator>Tom</dc:creator><description>&lt;p&gt;That is a good question. &amp;nbsp;There are some ways to do it that you can find online, like turning WFP off or disabling it for a folder. &amp;nbsp;If you'd like to do that, just search online and proceed with caution!&lt;/p&gt;
&lt;p&gt;The suggestion from Michael is a good solution if you know where you may run into this. &amp;nbsp;Generally it isn't a common problem unless you are doing some intensive work.&lt;/p&gt;
</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8353505</link><pubDate>Thu, 03 Apr 2008 14:36:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8353505</guid><dc:creator>rahulso</dc:creator><description>&lt;p&gt;Wow! Thanks for sharing that Tom :-)&lt;/p&gt;</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8415744</link><pubDate>Tue, 22 Apr 2008 03:29:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8415744</guid><dc:creator>Sidar Ok</dc:creator><description>&lt;P&gt;Hi Tom, thanks for the great post ! I am just wondering, this is such a hack, so does it have any legal implications - like microsoft accepting no responsibility or support etc. ? &lt;/P&gt;
&lt;P&gt;And I wonder your opinion, why isnt this configurable either through user friendly iis snap in or even metabase?&lt;/P&gt;</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8415940</link><pubDate>Tue, 22 Apr 2008 06:42:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8415940</guid><dc:creator>Tom</dc:creator><description>&lt;p&gt;Sidar,&lt;/p&gt;
&lt;p&gt;You are right, changing the file would mean we accept no responsibility, but it really wouldn't cause any harm. &amp;nbsp;Just have to watch out for updates changing the file back. &amp;nbsp;See some of the comments above for other options.&lt;/p&gt;
&lt;p&gt;I can't really comment on why it isn't configurable other then to say it was a decision they made. &amp;nbsp;Probably didn't think this was something that people would need to configure.&lt;/p&gt;
</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8463858</link><pubDate>Tue, 06 May 2008 23:19:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8463858</guid><dc:creator>Ajay</dc:creator><description>&lt;p&gt;Tom,&lt;/p&gt;
&lt;p&gt;Is it 256 KB for IIS 7 in Longhorn Server?&lt;/p&gt;</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8463890</link><pubDate>Tue, 06 May 2008 23:35:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8463890</guid><dc:creator>Tom</dc:creator><description>&lt;p&gt;Yes it is the same for Windows Server 2008&lt;/p&gt;
</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8899744</link><pubDate>Wed, 27 Aug 2008 15:26:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8899744</guid><dc:creator>Cesar</dc:creator><description>&lt;p&gt;Hello, i'm facing the same problem with my production site so i found this info very usefull but i've tried with &lt;/p&gt;
&lt;p&gt;C:\WINDOWS\system32\inetsrv&amp;gt;dumpbin /all /out:original-config.txt w3wp.exe&lt;/p&gt;
&lt;p&gt;Later with&lt;/p&gt;
&lt;p&gt;C:\WINDOWS\system32\inetsrv&amp;gt;EDITBIN /STACK:1048576 w3wp.exe&lt;/p&gt;
&lt;p&gt;And once finished with&lt;/p&gt;
&lt;p&gt;C:\WINDOWS\system32\inetsrv&amp;gt;dumpbin /all /out:modified-config.txt w3wp.exe&lt;/p&gt;
&lt;p&gt;and both output files (original-config.txt and modified-config.txt) are exactly the same, stack size was't modified :(&lt;/p&gt;
&lt;p&gt;and the web application remains without work.&lt;/p&gt;
&lt;p&gt;What I'm missing ?&lt;/p&gt;
&lt;p&gt;Thanks in advance.&lt;/p&gt;</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8900000</link><pubDate>Wed, 27 Aug 2008 16:31:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8900000</guid><dc:creator>molotov</dc:creator><description>&lt;p&gt;Hi Cesar,&lt;/p&gt;
&lt;p&gt;It's possible that WFP is kicking in. &amp;nbsp;Any entries in the event logs indicating that changes have been detected and that a file has been restored?&lt;/p&gt;</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8903258</link><pubDate>Thu, 28 Aug 2008 15:23:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8903258</guid><dc:creator>Cesar</dc:creator><description>&lt;p&gt;Yes molotov, &lt;/p&gt;
&lt;p&gt;In the event logs i have events indicating changes and restoration file on w3wp.exe&lt;/p&gt;
&lt;p&gt;I've disabled the firewall, but w3wp remains unchanged :( &lt;/p&gt;
&lt;p&gt;molotov = one of my favorite bands&lt;/p&gt;</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8903355</link><pubDate>Thu, 28 Aug 2008 16:28:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8903355</guid><dc:creator>molotov</dc:creator><description>&lt;p&gt;So WFP is restoring the original file after detecting modification. &amp;nbsp;WFP is discussed in the comments above, by Eber (&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8348630"&gt;http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8348630&lt;/a&gt;) and Tom (&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8348671"&gt;http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8348671&lt;/a&gt;).&lt;/p&gt;</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8916547</link><pubDate>Mon, 01 Sep 2008 16:09:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8916547</guid><dc:creator>Cesar</dc:creator><description>&lt;p&gt;Thank you so much, the problem was solved implementing the Michael Reyeros solution, creating a thread with the desired size and later join them to the main process.&lt;/p&gt;
&lt;p&gt;Tks!&lt;/p&gt;</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8917367</link><pubDate>Mon, 01 Sep 2008 21:46:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8917367</guid><dc:creator>molotov</dc:creator><description>&lt;p&gt;Good to hear you've found something that works, Cesar.&lt;/p&gt;
&lt;p&gt;Just be sure to note Tom's comment @ &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8347999"&gt;http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8347999&lt;/a&gt;&lt;/p&gt;</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8954466</link><pubDate>Wed, 17 Sep 2008 01:21:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8954466</guid><dc:creator>Michael</dc:creator><description>&lt;p&gt;I can not get it to work. What am I doing wrong? I have even tried it to a copy of the file and even tried in administrator mode. I am using Visual Studio 2008 Command Prompt&lt;/p&gt;
&lt;p&gt;C:\Windows\System32\inetsrv&amp;gt;EDITBIN /STACK:1048576 &amp;quot;w3wp - Copy.exe&amp;quot;&lt;/p&gt;
&lt;p&gt;Microsoft (R) COFF/PE Editor Version 9.00.21022.08&lt;/p&gt;
&lt;p&gt;Copyright (C) Microsoft Corporation. &amp;nbsp;All rights reserved.&lt;/p&gt;
&lt;p&gt;LINK : fatal error LNK1104: cannot open file 'w3wp - Copy.exe'&lt;/p&gt;
&lt;p&gt;C:\Windows\System32\inetsrv&amp;gt;&lt;/p&gt;</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8954478</link><pubDate>Wed, 17 Sep 2008 01:28:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8954478</guid><dc:creator>Michael</dc:creator><description>&lt;p&gt;I got it to work! While searching the web I found this entry.&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://forumplanet.gamespy.com/battlefield_2_technical_help/b49106/5428486/r19538781/"&gt;http://forumplanet.gamespy.com/battlefield_2_technical_help/b49106/5428486/r19538781/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Search down to GhostSpyke's post.&lt;/p&gt;
&lt;p&gt;It seems that you are not supposed to put spaces???&lt;/p&gt;
&lt;p&gt;Why is this?&lt;/p&gt;</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8954500</link><pubDate>Wed, 17 Sep 2008 01:50:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8954500</guid><dc:creator>Michael</dc:creator><description>&lt;p&gt;never mind it is not working what so ever.&lt;/p&gt;</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8955245</link><pubDate>Wed, 17 Sep 2008 12:47:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8955245</guid><dc:creator>Tom</dc:creator><description>&lt;p&gt;What operating system are you on? &amp;nbsp;You may be running into an issue with system file protection.&lt;/p&gt;
</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8956498</link><pubDate>Thu, 18 Sep 2008 04:44:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8956498</guid><dc:creator>Michael</dc:creator><description>&lt;p&gt;I am running Windows Vista Home Premium&lt;/p&gt;
&lt;p&gt;I have given Administrator ownership of the file and I have given it full access. I then do the same thing again on an administrator Visual Studio 2008 Command Prompt and I get the same link error.&lt;/p&gt;
&lt;p&gt;This is crazy. All this because Microsoft underestimates it's programmer's needs :-(&lt;/p&gt;</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#8957472</link><pubDate>Thu, 18 Sep 2008 19:09:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8957472</guid><dc:creator>Roger</dc:creator><description>&lt;p&gt;Michael's approach was working. I created a thread to handle the pdf content and the rendering in the IE browser. &amp;nbsp;But when my code rendered the pdf document to the browser, the pop-up browser was blank. The pdf content got rendered in Adobe Reader instead. If I removed my code change, the pdf content was rendered correctly in the browser.&lt;/p&gt;
&lt;p&gt;Do anybody know why this happened? Thanks. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note: Here is how I render the content&lt;/p&gt;
&lt;p&gt;MemoryStream ms = report.RunReport(...);&lt;/p&gt;
&lt;p&gt;Response.Buffer = true;&lt;/p&gt;
&lt;p&gt;Response.ClearContent();&lt;/p&gt;
&lt;p&gt;Response.ClearHeaders();&lt;/p&gt;
&lt;p&gt;Response.ContentType = &amp;quot;application/pdf&amp;quot;;&lt;/p&gt;
&lt;p&gt;Response.AddHeader(&amp;quot;content-disposition&amp;quot;, String.Format(&amp;quot;inline; filename=illustration{0}.pdf&amp;quot;, uniqueId));&lt;/p&gt;
&lt;p&gt;Response.BinaryWrite(ms.ToArray());&lt;/p&gt;
&lt;p&gt;Response.End();&lt;/p&gt;</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#9448977</link><pubDate>Fri, 27 Feb 2009 18:48:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9448977</guid><dc:creator>sebastian</dc:creator><description>&lt;p&gt;Hey, facing the same problem here. The EDITBIN solution worked for us but since we're shipping the product we need to increase the stack by code.&lt;/p&gt;
&lt;p&gt;I have two questions... &lt;/p&gt;
&lt;p&gt;1) My app just hosts WCF services... should I create the new thread in the Global.asax.cs's Application_Start?&lt;/p&gt;
&lt;p&gt;2) What about the child threads... the logic of the services sometimes creates new threads (BackgroundWroker). Will these inherit the size of the stack from the parent thread?&lt;/p&gt;
&lt;p&gt;TIA&lt;/p&gt;
&lt;p&gt;sebastian&lt;/p&gt;</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#9457927</link><pubDate>Wed, 04 Mar 2009 06:30:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9457927</guid><dc:creator>Tom</dc:creator><description>&lt;P&gt;Sebastian,&lt;/P&gt;
&lt;P&gt;A couple questions first, often times there is another way to design your application so you don't need this much stack space. &amp;nbsp;Have you investigated that yet?&lt;/P&gt;
&lt;P&gt;Application_Start should be a good place to create it.&lt;/P&gt;
&lt;P&gt;For new threads, the Thread constructor takes a maxStackSize parameter. &amp;nbsp;Take a look at: &lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/5cykbwz4(VS.80).aspx"&gt;http://msdn.microsoft.com/en-us/library/5cykbwz4(VS.80).aspx&lt;/A&gt;&lt;/P&gt;</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#9805613</link><pubDate>Fri, 26 Jun 2009 18:48:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9805613</guid><dc:creator>Robert</dc:creator><description>&lt;p&gt;I tried editing the stack size of w3wp.exe in its native folder, but even after carefully taking ownership of the file and granting Full control, I am getting &amp;quot;LINK : fatal error LNK1104: cannot open file 'w3wp.exe'&amp;quot;. &amp;nbsp;If I make a copy of the file to another folder, I can edit it OK. &amp;nbsp;But if I try to copy it back after editing, it appears that the copy worked OK (the directory entry shows the new modified date of the file) but the file has the old stack size again. &amp;nbsp;This happens even if I take ownership and full control of the Windows\System32\Inetsrv folder. &amp;nbsp;I think Windows Resource Control is doing something insidious here.&lt;/p&gt;
&lt;p&gt;I am using Windows Vista 64 bit.&lt;/p&gt;
&lt;p&gt;Is this a Windows Resource Control problem, and is there a way around it?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Robert&lt;/p&gt;</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#9805628</link><pubDate>Fri, 26 Jun 2009 19:15:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9805628</guid><dc:creator>Tom</dc:creator><description>&lt;p&gt;Robert,&lt;/p&gt;
&lt;p&gt;It is probably the windows file protection that is doing it. &amp;nbsp;So it is probably detecting that the file has changed and putting back the original. &amp;nbsp;If you check the timestamp, do you see the file go back to the old version?&lt;/p&gt;
</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#9805799</link><pubDate>Fri, 26 Jun 2009 22:05:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9805799</guid><dc:creator>Robert</dc:creator><description>&lt;p&gt;No Tom, the timestamp stays the same. &amp;nbsp;From what I can tell, Windows Resource Protection under Vista works differently than the old &amp;quot;Windows File Protection&amp;quot;. &amp;nbsp;I don't fully understand how, though. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;All I know is, I can modify a copy of the file in a different folder, verify with DumpBin that the stack size has changed, then copy the file to the Inetsrv folder, and the timestamp of the file in Inetsrv now reflects the new timestamp of the modified file, suggesting the copy was successful. &amp;nbsp;However, when I run Dumpbin on it, the stacksize is back to 40000 hex. &lt;/p&gt;
&lt;p&gt;I think Windows Resource Protection makes an extra effort to trick a legacy installer into thinking it successfully copied a file, when it really didn't. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;The question is, is there a way to get around this? &amp;nbsp;I've seen other posts from people that think if you take ownership of a file and give yourself full control, you can edit system files, but that doesn't seem to be working for me. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you heard of any way of doing this?&lt;/p&gt;</description></item><item><title>re: Stack sizes in IIS - affects ASP.NET</title><link>http://blogs.msdn.com/tom/archive/2008/03/31/stack-sizes-in-iis-affects-asp-net.aspx#9806218</link><pubDate>Sat, 27 Jun 2009 05:45:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9806218</guid><dc:creator>molotov</dc:creator><description>&lt;p&gt;Robert - in addition, check the event logs for messages that may relate to WFP kicking in...&lt;/p&gt;</description></item></channel></rss>