Haim Bender
Haim Bender

Reputation: 8187

Increase Stack size IIS ASP.NET 3.5

I understand that the default max stack size on ASP.NET was decreased to 256K instead of 1MB (see http://support.microsoft.com/kb/932909), how can I get it back to 1MB?

Upvotes: 6

Views: 6749

Answers (2)

massimogentilini
massimogentilini

Reputation: 4172

Another solution could be that of creating an explicit new thread to perform the operations where you're getting a stack overflow error

  Thread t = new Thread(Run, 4194304); // 4M of stack size
  t.Start();
  t.Join();
  if (loadException != null) throw loadException;

  void Run()
        {
            try
            {
              // Operation causing stack overflow
            }
            catch (Exception e)
            {
              ...
            }
        }

Regards

Massimo

Upvotes: 6

Oded
Oded

Reputation: 499002

You can use editbin, as described in this article.

Upvotes: 6

Related Questions