【发布时间】:2026-02-10 17:45:01
【问题描述】:
我相信我有一个用 C# 编写的应用程序,它将图像添加到 SQL Server 2005 数据库。它需要在我的计算机上安装 .NET 3.5。我安装了 .NET 3.5 并设置了一个数据库。它运行良好,但是一旦在一台计算机上运行时到达图像 100,它就会停止并给我这个错误:无法打开带有错误的图像:外部组件已引发异常....
当我在自己的计算机上运行该程序时,我可以访问 300 张图像,但在 300 张图像后它会停止,并显示无法打开图像并出现错误:外部组件已引发异常...。再次出错。
请帮忙!
这是一个堆栈:
有关调用的详细信息,请参阅此消息的末尾 即时 (JIT) 调试,而不是此对话框。
**************异常文本************** System.OutOfMemoryException:引发了“System.OutOfMemoryException”类型的异常。 在 System.String.GetStringForStringBuilder(字符串值,Int32 startIndex,Int32 长度,Int32 容量) 在 System.Text.StringBuilder..ctor(字符串值,Int32 startIndex,Int32 长度,Int32 容量) 在 System.Windows.Forms.Control.get_WindowText() 在 System.Windows.Forms.TextBoxBase.get_WindowText() 在 System.Windows.Forms.Control.set_CacheTextInternal(布尔值) 在 System.Windows.Forms.Control.PerformLayout(LayoutEventArgs 参数) 在 System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.PerformLayout(IArrangedElement 影响元素,字符串影响属性) 在 System.Windows.Forms.Layout.LayoutTransaction.DoLayout(IArrangedElement elementToLayout,IArrangedElement elementCausingLayout,String 属性) 在 System.Windows.Forms.Control.OnResize(EventArgs e) 在 System.Windows.Forms.Control.OnSizeChanged (EventArgs e) 在 System.Windows.Forms.Control.UpdateBounds(Int32 x,Int32 y,Int32 宽度,Int32 高度,Int32 clientWidth,Int32 clientHeight) 在 System.Windows.Forms.Control.UpdateBounds() 在 System.Windows.Forms.Control.WndProc(消息和 m) 在 System.Windows.Forms.TextBoxBase.WndProc(消息和 m) 在 System.Windows.Forms.TextBox.WndProc(消息和 m) 在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(消息& m) 在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(消息和 m) 在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** 加载的程序集 ************** mscorlib 程序集版本:2.0.0.0 Win32版本: 代码库:file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
【问题讨论】:
-
基于您似乎没有代码并且仅“认为”应用程序是用 C# 编写的这一事实,我猜您没有编写它。获得修复的唯一方法是联系程序的作者。