SEHException occurred

本文关键字:occurred SEHException | 更新日期: 2023-09-27 18:19:08

在尝试通过网络访问程序集时,突然发生SEHException。应用程序已部署在服务器(Windows server 2003)上,并在.NET Framework 1.1和windows C#应用程序上运行。它已经部署并运行了很长时间。下面是异常

的堆栈跟踪

* System.Runtime.InteropServices。SEHException'发生并被捕获。------------------------------------------------------------------------------------------- 06/13/2013 12:41:19类型:System.Runtime.InteropServices.SEHException mscorlib
版本=2.0.0.0文化=中性PublicKeyToken=b77a5c561934e089消息:外部组件抛出异常。来源:mscorlib帮助链接:ErrorCode: -2147467259System.Collections.ListDictionaryInternal Stack Trace: atSystem.Reflection.Assembly。_GetResource(String resourceName)StackCrawlMark&amp长度;stackMark布尔值skipSecurityCheck)System.Reflection.Assembly。GetResource(String resourceName)StackCrawlMark&amp长度;stackMark布尔值skipSecurityCheck)System.Reflection.Assembly。GetManifestResourceStream(字符串名称
StackCrawlMark&stackMark布尔值skipSecurityCheck)System.Reflection.Assembly。GetManifestResourceStream(类型)名称Boolean skipSecurityCheck StackCrawlMark&stackMark)System.Resources.ResourceManager.InternalGetResourceSet (CultureInfocreateIfNotExists布尔类型的父类System.Resources.ResourceManager.InternalGetResourceSet (CultureInfocreateIfNotExists布尔类型的父类System.Resources.ResourceManager.InternalGetResourceSet (CultureInfocreateIfNotExists布尔类型的父类System.Resources.ResourceManager。GetObject(字符串名称文化信息)文化布尔wrapUnmanagedMemStream)System.Resources.ResourceManager。GetObject(字符串名称)shoppingcartBO。messageLabel_Paint(对象发送方PaintEventArgs e)
在System.Windows.Forms.Control。OnPaint(PaintEventArgs)System.Windows.Forms.Label。OnPaint(PaintEventArgs)System.Windows.Forms.Control。PaintWithErrorHandling (PaintEventArgs e
Int16层布尔处置eventargs)System.Windows.Forms.Control.WmPaint (Message&米)System.Windows.Forms.Control.WndProc (Message&米)System.Windows.Forms.Label.WndProc (Message&米)System.Windows.Forms.Control.ControlNativeWindow.OnMessage (Message&米)在System.Windows.Forms.Control.ControlNativeWindow.WndProc (Message&m)在System.Windows.Forms.NativeWindow。回调(IntPtr hWnd
Int32 msg IntPtr wparam IntPtr lparam)*

关闭并重新启动应用程序后没有出现此问题。这个问题已经被报告了200多次了,我们需要解决这个问题。

SEHException occurred

在我们的案例中,这个问题是由以下原因引起的:

  1. 应用程序从远程计算机的网络共享中启动
  2. 客户端计算机处于睡眠状态,应用程序正在运行
  3. 网络共享应用程序更新为新的exe文件
  4. 客户端计算机已恢复。应用程序仍在运行旧版本的exe(缓存在内存中)。在此之后,应用中的某些动作引发了Assembly.GetManifestResourceStream的调用,导致SEHException

我们通过重新组织应用程序来解决这个问题,使这种情况不会发生