Click here to Skip to main content
15,909,373 members

Comments by ZhaoChaoHui (Top 2 by date)

ZhaoChaoHui 15-Oct-20 23:13pm View    
I have add ThrowUnobservedTaskExceptions config:
<runtime>
<legacyCorruptedStateExceptionsPolicy enabled="true"/>
<ThrowUnobservedTaskExceptions enabled="true"/>
</runtime>

This is really work while i throw exception in Tasks on my own initiative. I hope it can catch the bugs. Thank you.
ZhaoChaoHui 15-Oct-20 20:44pm View    
The code is wrote At the beginning of "static void Main(string[] param)", they work both debug mode and release mode.

static void Main(string[] param)
{
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
......


The bugs of exit suddenly happen in release mode, but I'm not sure whether it happen in debug mode or not.