c# - 来自单声道的奇怪的未处理异常

标签 c# linux mono monodevelop

我们的产品使用 mono 4.8.0。在不同类型的 Linux 上运行特定测试时,我们偶尔会触发未处理的异常。更具体地说,AppDomain.UnhandledException 事件被触发。但是我们无法弄清楚是哪一行代码触发了异常。我想知道这是单声道的缺陷吗?

[ERROR] FATAL UNHANDLED EXCEPTION: System.ExecutionEngineException: ExecutionContext_ExceptionInAsyncLocalNotification ---> System.Threading.ThreadAbortException at System.Collections.Generic.ObjectEqualityComparer'1[T].Equals (T x, T y) <0x7f0f20aa1e80 + 0x00000> in :0 at System.Collections.Generic.Dictionary'2[TKey,TValue].FindEntry (TKey key) [0x0005d] in :0 at System.Collections.Generic.Dictionary'2[TKey,TValue].TryGetValue (TKey key, TValue& value) [0x00000] in :0 at System.Threading.ExecutionContext.OnAsyncLocalContextChanged (System.Threading.ExecutionContext previous, System.Threading.ExecutionContext current) [0x00119] in ...../mono/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:749 --- End of inner exception stack trace --- at System.Environment.FailFast (System.String message, System.Exception exception) [0x00000] in ...../mono/mono/mcs/class/corlib/System/Environment.cs:929 at System.Threading.ExecutionContext.OnAsyncLocalContextChanged (System.Threading.ExecutionContext previous, System.Threading.ExecutionContext current) [0x00164] in ..../mono/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:758 at System.Threading.ExecutionContext.SetExecutionContext (System.Threading.ExecutionContext executionContext, System.Boolean preserveSyncCtx) [0x0005f] in ..../mono/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:1028

谢谢

最佳答案

尝试 <AppContextSwitchOverrides value="Switch.System.Globalization.NoAsyncCurrentCulture=true" />并避免使用 AsyncLocal<T>

关于c# - 来自单声道的奇怪的未处理异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49757479/

相关文章:

c# - 在 ListArray C# 中搜索

c# - Httpclient tpl并行多请求最快方式

java - 不需要操作系统的.NET CLR?

c# - 来自 Mono 的 TypeLoadException

c# - 使用窗口句柄获取 IUnkown

c# - WPF - ContentPresenter 不绑定(bind)到 UserControl 内容

linux - 如何创建彩色文本?

linux - SSH 交换 ctrl 和 caps

linux - 克隆 PostgreSQL 数据库

c# - 在具有外部Visual Studio版本的Windows(2017)上,无法为PC Standalone生成Unity5项目