Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. handling Stack overflow Exception

handling Stack overflow Exception

Scheduled Pinned Locked Moved C#
csharphelpdata-structurestutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    abhinish
    wrote on last edited by
    #1

    hi guys ! need some help... i m using Devmail.net component for downloading mails but while using it i m having a problem there occurs a Stack overflow Exception while downloading msg.MessageSource (body of message) in some mails ,becuase of it my whole application crashes and i m unable to handle it in try catch block.. can any one help me in telling how to catch this exception i m using c# and the programming language can anyone hlp me as i tried a lot in Devmail.net help and forum but couldnt find the solution its urgent... thanks abhinav Systweak Inc. jaipur India..

    W 1 Reply Last reply
    0
    • A abhinish

      hi guys ! need some help... i m using Devmail.net component for downloading mails but while using it i m having a problem there occurs a Stack overflow Exception while downloading msg.MessageSource (body of message) in some mails ,becuase of it my whole application crashes and i m unable to handle it in try catch block.. can any one help me in telling how to catch this exception i m using c# and the programming language can anyone hlp me as i tried a lot in Devmail.net help and forum but couldnt find the solution its urgent... thanks abhinav Systweak Inc. jaipur India..

      W Offline
      W Offline
      Werdna
      wrote on last edited by
      #2

      Unfortunatelly as of .net 2 you cannot catch this exception. Here is the info from .net docs: In prior versions of the .NET Framework, your application could catch a StackOverflowException object (for example, to recover from unbounded recursion). However, that practice is currently discouraged because significant additional code is required to reliably catch a stack overflow exception and continue program execution. Starting with the .NET Framework version 2.0, a StackOverflowException object cannot be caught by a try-catch block and the corresponding process is terminated by default. Consequently, users are advised to write their code to detect and prevent a stack overflow. For example, if your application depends on recursion use a counter or a state condition to terminate the recursive loop.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups