3
votes

I have made a C# project. Every thing is working fine when i run project through Visual Studio 2010. After that i have created setup for this solution and when i tried to open the dialog box then it showed the above error. After running project from setup file it also making trouble to write into database. Here is the complete stack of exception that came on access of dialog.

See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.

***** Exception Text ******* System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at System.Windows.Forms.FileDialogNative.IFileDialog.Show(IntPtr parent) at System.Windows.Forms.FileDialog.RunDialogVista(IntPtr hWndOwner) at System.Windows.Forms.FileDialog.RunDialog(IntPtr hWndOwner) at System.Windows.Forms.CommonDialog.ShowDialog(IWin32Window owner) at System.Windows.Forms.CommonDialog.ShowDialog() at Email_Client.ImportContacts.btnBrowse_Click(Object sender, EventArgs e) in E:\Development.net Projects\Email Client\Email Client\ImportContacts.cs:line 35 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Please help.

1
What use is a stack trace w/o the code that generates it? - spender
Yep. You have a bug. probably in ImportContacts.cs at line 35. What, you want more info? Same here... - John3136

1 Answers

0
votes

I was the same problem and i solved it by install Hotfix https://support.microsoft.com/en-us/hotfix/kbhotfix?kbnum=2516475&kbln=en-US in my case the problem occured because i use accdb instead of mdb vb.net or c#