System.Collections.Generic.KeyNotFoundException

Mar 25, 2011 at 3:21 AM

Thanks your guys open the source here, and this indeed save me much time.
But there maybe some error in the code, belowing is the exceptions catched by VS.net 2005.
These exceptions happend when I Unregister the server and Register it after a while.
PS: my vb.net2005 is Chinese edition, the following message is translated by google.
-----------------------------------------------------------------------------------------------------------

The first time in System.Collections.Generic.KeyNotFoundException occasional "mscorlib.dll" exception of type 
"DDEServer.vshost.exe" (Managed): Loaded "C: \ WINDOWS \ assembly \ GAC_MSIL \ System.Transactions.resources \ 2.0.0.0_zh-CHS_b77a5c561934e089 \ System.Transactions.resources.dll", No symbols loaded . 
System.Transactions Critical: 0: <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"> <TraceIdentifier> http://msdn.microsoft.com/TraceCodes / System/ActivityTracing/2004/07/Reliability/Exception/Unhandled </ TraceIdentifier> <Description> unhandled exception </ Description> <AppDomain> DDEServer.vshost.exe </ AppDomain> <Exception> <ExceptionType> System.Collections . Generic.KeyNotFoundException, mscorlib, Version = 2.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089 </ ExceptionType> <Message> a given keyword is not in the dictionary. </ Message> <StackTrace> in System.ThrowHelper.ThrowKeyNotFoundException () 
   
In System.Collections.Generic.Dictionary `2.get_Item (TKey key) 
   
In NDde.Foundation.Server.DdemlServer.ProcessCallback (DdemlTransaction transaction) location F: \ DotNet \ VB \ DDEServer \ NDde \ Source \ NDde \ Internal \ Server \ DdemlServer.cs: line number 535 
   
In NDde.Foundation.Advanced.DdemlContext.OnDdeCallback (Int32 uType, Int32 uFmt, IntPtr hConv, IntPtr hsz1, IntPtr hsz2, IntPtr hData, IntPtr dwData1, IntPtr dwData2) location F: \ DotNet \ VB \ DDEServer \ NDde \ Source \ NDde \ Internal \ Advanced \ DdemlContext.cs: line number 307 
   
In System.Windows.Forms.UnsafeNativeMethods.DispatchMessageA (MSG &amp; msg) 
   
In System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop (Int32 dwComponentID, Int32 reason, Int32 pvLoopData) 
   
In System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner (Int32 reason, ApplicationContext context) 
   
In System.Windows.Forms.Application.ThreadContext.RunMessageLoop (Int32 reason, ApplicationContext context) 
   
In System.Windows.Forms.Application.Run (Form mainForm) 
   
In NDde.Advanced.DdeContext.DdeThread.Run () location F: \ DotNet \ VB \ DDEServer \ NDde \ Source \ NDde \ Public \ Advanced \ DdeContext.cs: line number 757 
   
In System.Threading.ThreadHelper.ThreadStart_Context (Object state) 
   
In System.Threading.ExecutionContext.runTryCode (Object userData) 
   
In System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup (TryCode code, CleanupCode backoutCode, Object userData) 
   
In System.Threading.ExecutionContext.RunInternal (ExecutionContext executionContext, ContextCallback callback, Object state) 
   
In System.Threading.ExecutionContext.Run (ExecutionContext executionContext, ContextCallback callback, Object state) 
   
In System.Threading.ThreadHelper.ThreadStart () </ StackTrace> <ExceptionString> System.Collections.Generic.KeyNotFoundException: for a given keyword is not in the dictionary. 
   
In System.ThrowHelper.ThrowKeyNotFoundException () 
   
In System.Collections.Generic.Dictionary `2.get_Item (TKey key) 
   
In NDde.Foundation.Server.DdemlServer.ProcessCallback (DdemlTransaction transaction) location F: \ DotNet \ VB \ DDEServer \ NDde \ Source \ NDde \ Internal \ Server \ DdemlServer.cs: line number 535 
   
In NDde.Foundation.Advanced.DdemlContext.OnDdeCallback (Int32 uType, Int32 uFmt, IntPtr hConv, IntPtr hsz1, IntPtr hsz2, IntPtr hData, IntPtr dwData1, IntPtr dwData2) location F: \ DotNet \ VB \ DDEServer \ NDde \ Source \ NDde \ Internal \ Advanced \ DdemlContext.cs: line number 307 
   
In System.Windows.Forms.UnsafeNativeMethods.DispatchMessageA (MSG &amp; msg) 
   
In System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop (Int32 dwComponentID, Int32 reason, Int32 pvLoopData) 
   
In System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner (Int32 reason, ApplicationContext context) 
   
In System.Windows.Forms.Application.ThreadContext.RunMessageLoop (Int32 reason, ApplicationContext context) 
   
In System.Windows.Forms.Application.Run (Form mainForm) 
   
In NDde.Advanced.DdeContext.DdeThread.Run () location F: \ DotNet \ VB \ DDEServer \ NDde \ Source \ NDde \ Public \ Advanced \ DdeContext.cs: line number 757 
   
In System.Threading.ThreadHelper.ThreadStart_Context (Object state) 
   
In System.Threading.ExecutionContext.runTryCode (Object userData) 
   
In System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup (TryCode code, CleanupCode backoutCode, Object userData) 
   
In System.Threading.ExecutionContext.RunInternal (ExecutionContext executionContext, ContextCallback callback, Object state) 
   
In System.Threading.ExecutionContext.Run (ExecutionContext executionContext, ContextCallback callback, Object state) 
   
In System.Threading.ThreadHelper.ThreadStart () </ ExceptionString> </ Exception> </ TraceRecord> 
Program "[3040] DDEServer.vshost.exe: Managed" is out, the return value -2146233082 (0x80131506).