Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/329.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 莫名其妙的例外_C#_.net_Multithreading_Exception - Fatal编程技术网

C# 莫名其妙的例外

C# 莫名其妙的例外,c#,.net,multithreading,exception,C#,.net,Multithreading,Exception,我正在开发一个.net中间件结构,最近在调试应用程序时,大约20-30秒后,我突然遇到了以下异常 System.Reflection.AmbiguousMatchException was unhandled Message: An unhandled exception of type 'System.Reflection.AmbiguousMatchException' occurred in mscorlib.dll Additional information: A

我正在开发一个.net中间件结构,最近在调试应用程序时,大约20-30秒后,我突然遇到了以下异常

 System.Reflection.AmbiguousMatchException was unhandled
     Message: An unhandled exception of type 'System.Reflection.AmbiguousMatchException' occurred in mscorlib.dll
     Additional information: Ambiguous match found.
奇怪的是,我一行代码都没有改变,我只是在调试它。当我以发布模式将其作为服务安装时,它可以正常工作。此外,它正在其他计算机上工作。 当我第一次遇到这种奇怪的行为时,我重新安装了计算机,突然异常消失了。但在调试模式下第二次启动中间件后,异常又回来了。 请注意,我没有更改调试首选项中的任何内容

以下是发生异常时输出日志中的一些详细信息

系统。关键事务:0: 未处理 例外情况

mscorlib,版本=4.0.0.0,区域性=中性, PublicKeyToken=B77A5C561934E089不明确 找到匹配项。在 System.DefaultBinder.FindMostDerivedNewSlotMeth(MethodBase[]匹配, Int32(cMatches)

hermesklin.Middleware.Service.vshost.exeSystem.Reflection.AmbiguousMatchException

位于System.RuntimeType.GetMethodImpl(字符串名称、BindingFlags bindingAttr、Binder Binder、CallingConventions callConv、Type[]类型、ParameterModifier[]修饰符)

位于System.Reflection.Emit.TypeBuilder.GetMethodImpl(字符串名称、BindingFlags bindingAttr、Binder Binder、CallingConventions callConvention、Type[]类型、ParameterModifier[]修饰符)

at System.Type.GetMethod(字符串名称) 位于System.Activities.Debugger.State.GetMethodInfo(带启动的布尔值) 位于System.Activities.Debugger.StateManager.InvokeWorker(对象islandArguments,VirtualStackFrame stackFrame) 位于System.Activities.Debugger.ThreadWorkerController.Worker(布尔值isAtStartup)

位于System.Activities.Debugger.ThreadWorkerController.WorkerThreadProc()处 位于System.Threading.ExecutionContext.RunInternal(ExecutionContext ExecutionContext、ContextCallback回调、对象状态、布尔值preserveSyncCtx) 在System.Threading.ExecutionContext.Run(ExecutionContext ExecutionContext,ContextCallback回调,对象状态,布尔保存SyncCTX) 在System.Threading.ExecutionContext.Run(ExecutionContext ExecutionContext,ContextCallback回调,对象状态) 位于System.Threading.ThreadHelper.ThreadStart()System.Reflection.AmbiguousMatchException:找到不明确的匹配。 位于System.DefaultBinder.FindMostDerievedNewslotMeth(MethodBase[]匹配,Int32 cMatches)

位于System.RuntimeType.GetMethodImpl(字符串名称、BindingFlags bindingAttr、Binder Binder、CallingConventions callConv、Type[]类型、ParameterModifier[]修饰符)

位于System.Reflection.Emit.TypeBuilder.GetMethodImpl(字符串名称、BindingFlags bindingAttr、Binder Binder、CallingConventions callConvention、Type[]类型、ParameterModifier[]修饰符) at System.Type.GetMethod(字符串名称) 位于System.Activities.Debugger.State.GetMethodInfo(带启动的布尔值) 位于System.Activities.Debugger.StateManager.InvokeWorker(对象islandArguments,VirtualStackFrame stackFrame) 位于System.Activities.Debugger.ThreadWorkerController.Worker(布尔值isAtStartup)

位于System.Activities.Debugger.ThreadWorkerController.WorkerThreadProc()处 位于System.Threading.ExecutionContext.RunInternal(ExecutionContext ExecutionContext、ContextCallback回调、对象状态、布尔值preserveSyncCtx) 在System.Threading.ExecutionContext.Run(ExecutionContext ExecutionContext,ContextCallback回调,对象状态,布尔保存SyncCTX) 在System.Threading.ExecutionContext.Run(ExecutionContext ExecutionContext,ContextCallback回调,对象状态)


在System.Threading.ThreadHelper.ThreadStart()。可能您正在手动添加一些系统库,或者您有一个奇怪的程序集清单?很遗憾,我无法添加任何代码。当应用程序已经运行时,异常会在一段时间后随机启动。我看不出它是从哪里来的。调试器告诉我,如果我想查看更多详细信息,我必须禁用“仅我的代码”并加载符号。但即使我这样做,我也得不到更多的信息。还有一点需要注意:异常发生在调试器线程本身。@Hannes上次我得到这样的行为时(调试失败,正常运行继续,就像没有buddy的事情一样)这是一个调用函数的无限循环,它自己调用它,所以你最好先禁用一些看起来奇怪的东西,并寻找一些奇怪的引用调用。但是代码至少一个月都是相同的,我们一直在调试它。我是唯一一个得到这些例外的人。windows update有可能做到这一点吗?我是唯一一个默认启用它们的人。。。