StackoverflowException in IIS7 but not in Cassini

…衆ロ難τιáo~ 提交于 2019-12-11 07:34:07

问题


I have some C# code that is giving a StackOverflowException when running under IIS7 but when it is run under Cassini in VS2008 then the code runs fine.

Is this a known issue whereby Cassini handles these kinds of exceptions differently?


回答1:


The IIS runtime uses a different stack size for threads. IIRC it is 256 KB as opposed to the standard 1 MB you get when running on the standard .NET runtime, which is the one VS uses. In other words, you may have code that runs fine under the regular .NET runtime, but which exhausts the stack under IIS.

From looking at Cassini it sounds like it uses the regular .NET runtime, so I would expect it to use a stack size of 1 MB per thread as well.




回答2:


you can change the stack size using the EDITBIN command. or change it by creating yourown thread with required stack size



来源:https://stackoverflow.com/questions/4013037/stackoverflowexception-in-iis7-but-not-in-cassini

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!