Hannes
Hannes

Reputation: 21

Strange exceptions out of nowhere

I'm working on a .net Middleware structure and recently I suddenly got the following exception after about 20-30 seconds when I was debugging the application.

 System.Reflection.AmbiguousMatchException was unhandled
     Message: An unhandled exception of type 'System.Reflection.AmbiguousMatchException' occurred in mscorlib.dll
     Additional information: Ambiguous match found.

Strangely I did not change a single line a code, I'm really just debugging it. When I install it as a service in release mode it works. Furthermore it is working on other computers. When I first encountered this strange behaviour I re-installed my computer and suddenly the exception was gone. But after the second start of the Middle ware in debug mode the exception was back. Just as a note, I did not change anything in the DEBUG preferences.

Here are some more details from the output log when the exception occurs.

System.Transactions Critical: 0 : http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/UnhandledUnhandled exception

mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089Ambiguous match found. at System.DefaultBinder.FindMostDerivedNewSlotMeth(MethodBase[] match, Int32 cMatches)

hermeskim.Middleware.Service.vshost.exeSystem.Reflection.AmbiguousMatchException,

at System.RuntimeType.GetMethodImpl(String name, BindingFlags bindingAttr, Binder binder, CallingConventions callConv, Type[] types, ParameterModifier[] modifiers)

at System.Reflection.Emit.TypeBuilder.GetMethodImpl(String name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)

at System.Type.GetMethod(String name) at System.Activities.Debugger.State.GetMethodInfo(Boolean withPriming) at System.Activities.Debugger.StateManager.InvokeWorker(Object islandArguments, VirtualStackFrame stackFrame) at System.Activities.Debugger.ThreadWorkerController.Worker(Boolean isAtStartup)

at System.Activities.Debugger.ThreadWorkerController.WorkerThreadProc() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()System.Reflection.AmbiguousMatchException: Ambiguous match found. at System.DefaultBinder.FindMostDerivedNewSlotMeth(MethodBase[] match, Int32 cMatches)

at System.RuntimeType.GetMethodImpl(String name, BindingFlags bindingAttr, Binder binder, CallingConventions callConv, Type[] types, ParameterModifier[] modifiers)

at System.Reflection.Emit.TypeBuilder.GetMethodImpl(String name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) at System.Type.GetMethod(String name) at System.Activities.Debugger.State.GetMethodInfo(Boolean withPriming) at System.Activities.Debugger.StateManager.InvokeWorker(Object islandArguments, VirtualStackFrame stackFrame) at System.Activities.Debugger.ThreadWorkerController.Worker(Boolean isAtStartup)

at System.Activities.Debugger.ThreadWorkerController.WorkerThreadProc() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

at System.Threading.ThreadHelper.ThreadStart()

Upvotes: 1

Views: 1854

Answers (1)

Hannes
Hannes

Reputation: 21

The problem was in the config files where I accidentally started the same Workflow 2 times.

Upvotes: 1

Related Questions