【问题标题】:When open dialog System.AccessViolationException:Attempted to read or write protected memory.This is often an indication that other memory is corrupt打开对话框时 System.AccessViolationException:Attempted to read or write protected memory.This 通常表示其他内存已损坏
【发布时间】:2013-06-16 18:29:08
【问题描述】:

我做了一个 C# 项目。当我通过 Visual Studio 2010 运行项目时,一切正常。之后,我为此解决方案创建了设置,当我尝试打开对话框时,它显示了上述错误。从安装文件运行项目后,写入数据库也很麻烦。 这是访问对话框时出现的完整异常堆栈。

有关调用即时的详细信息,请参阅此消息的末尾 (JIT) 调试而不是此对话框。

*****异常文本** ***** System.AccessViolationException: 试图读或写保护 记忆。这通常表明其他内存已损坏。
在 System.Windows.Forms.FileDialogNative.IFileDialog.Show(IntPtr 父)在 System.Windows.Forms.FileDialog.RunDialogVista(IntPtr hWndOwner) 在 System.Windows.Forms.FileDialog.RunDialog(IntPtr hWndOwner) 在 System.Windows.Forms.CommonDialog.ShowDialog(IWin32Window 所有者)在 System.Windows.Forms.CommonDialog.ShowDialog() 在 Email_Client.ImportContacts.btnBrowse_Click(对象发件人,EventArgs e) 在 E:\Development.net Projects\Email Client\Email Client\ImportContacts.cs:第 35 行,位于 System.Windows.Forms.Control.OnClick(EventArgs e) 在 System.Windows.Forms.Button.OnClick(EventArgs e) 在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs 事件) 在 System.Windows.Forms.Control.WmMouseUp(消息和 m,鼠标按钮 按钮,Int32 点击)在 System.Windows.Forms.Control.WndProc(Message& m) 在 System.Windows.Forms.ButtonBase.WndProc(Message& m) 在 System.Windows.Forms.Button.WndProc(Message& 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)

请帮忙。

【问题讨论】:

  • 没有生成它的代码的堆栈跟踪有什么用?
  • 是的。你有一个错误。可能在第 35 行的 ImportContacts.cs 中。什么,您想要更多信息?这里也一样...

标签: c# runtime-error


【解决方案1】:

我也是同样的问题,我通过安装 Hotfix 解决了 https://support.microsoft.com/en-us/hotfix/kbhotfix?kbnum=2516475&kbln=en-US 就我而言,出现问题是因为我使用 accdb 而不是 mdb vb.net 或 c#

【讨论】:

    猜你喜欢
    • 2021-05-08
    • 1970-01-01
    • 2016-01-08
    • 1970-01-01
    • 1970-01-01
    • 2013-01-23
    • 2011-07-13
    • 2010-10-27
    相关资源
    最近更新 更多