Home > Net >  [Winfrom] made close monitoring and logging is still without any performance automatically shut down
[Winfrom] made close monitoring and logging is still without any performance automatically shut down

Time:11-23

Project for all operations within the operation including thread add exception handling and logging, the program and logging, the closing of the event listeners do to program memory usage time logging, logging the read-write lock protect multi-threaded, speaking, reading and writing, speaking, reading and writing are wrong also can play box prompts, however the program running on the server variable found out they had shut down automatically after a long period of time, the longest shortest three to four days for a few minutes, through another console program waiting for the end, find ExitCode is 1, novice programming, was the reason have no idea that there will be what reason can lead to such a situation, how to begin to troubleshoot the problem?

CodePudding user response:

Must be abnormal no captures, add more try... The catch, and don't try, outside the thread to try within the thread, such as Task. Run (()=& gt; {the try... Catch})

CodePudding user response:

Global did not handle exceptions capture
https://www.cnblogs.com/rongfengliang/articles/3364986.html

CodePudding user response:

reference 1st floor ajdkjalj response:
must be abnormal didn't catch, and add some more try... The catch, and don't try, outside the thread to try within the thread, such as Task. Run (()=& gt; {the try... Catch})


Is within the thread to catch exceptions,



refer to the second floor dmankill response:
global did not handle exceptions capture
https://www.cnblogs.com/rongfengliang/articles/3364986.html


With the entrance of the program do not handle exceptions capture UnhandledException and ThreadException wrote

CodePudding user response:

As you said your code's abnormal can be ruled out
So if you use the external libraries such as c + + libraries or other scripting plug-ins can be crash led to the collapse of the entire program you these things
  •  Tags:  
  • C#
  • Related