.NET Framework Developer Center > .NET Development Forums > Network Class Library (System.Net) > MyApp has encountered a serious problem and needs to close
Ask a questionAsk a question
 

AnswerMyApp has encountered a serious problem and needs to close

  • Saturday, October 17, 2009 1:36 PMleopard-saleh Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    hey all...
    i have simple smtp application which sends email every random time...

    so it has to work for days continuously.....

    so to achieve that .... i had to activate it (send emails) for a random period and deactivate it( sleep )  for also random period....

    thus i used threading ( run, suspend, abort and sleep are all the function i used in threading)....

    well after five or six hours windows gives this error that " Email application has encountered a serious problem and needs to close [send , don't send] "...

    i don't know if this error messages is sort of exception cuz i'v never faced it before....

    well it should be mentioned that the body of the emails is a word file that is saved as html.....

    all the posts are appreciated and thanx in advance....

Answers

All Replies

  • Saturday, October 17, 2009 10:08 PMleopard-saleh Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    well ...it's worth to be mentioned that when the thread sleeps , it sleeps for a long period say 15 minutes( Thread.Sleep( 15 * 60 * 1000 ) ) .... does that make that effect(application crash) ????....

    if so ... is there other better way to handle the thread ( sleeping , pausing and resuming ) that is safer ??

    and thanx alot...
  • Monday, October 19, 2009 3:15 AMFeroze Daud Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Looks like you are getting an exception that is unhandled on your threads.

    Wrap the code running in the threads that you start with a try/catch and log the exception that you get there. That will help figure out what is happening.
    feroze
    --
    My blog
    Instruction on how to create a tracelog with your System.Net application
  • Wednesday, October 21, 2009 2:01 AMccbristo Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Instead of sleeping a thread for a lengthy period of time, would it be possible to use a scheduled task instead?  I don't think you would be able to do random intervals this way though.

  • Monday, October 26, 2009 9:47 AMleopard-saleh Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    exactly .... the problem was that visual studio was not installed and that caused that error....
    so it solved by installing visual studio and configuring where the problem occurred ......

    thanx guys.....