我遇到了异常,这似乎很少发生,但不是在可重复的条件下。这里的堆栈跟踪:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at System.Windows.Forms.Application.ThreadContext.ProcessFilters(MSG& msg, Boolean& modified)
at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)
at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FPreTranslateMessage(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
一个应用程序正在使用它自己的MessageFilter,遗憾的是我无法发布源代码,但仅通过堆栈跟踪看起来它似乎没什么帮助,而且额外的搜索显示(source,显然与另一个应用程序相关,发生此类异常):
这是由.Net运行时事件循环中的Microsoft错误引起的。该 问题涉及运行时如何处理内部事件消息 应用程序注册的过滤器。指数提到 在消息中是一个用于处理消息过滤器的索引 该申请正在退出。但在这个特殊的微软bug中 消息过滤器引用不再有效。
问题是:针对该特定问题是否有任何变通方法?