我尝试运行应用程序的两种情况:安装了SQL Server Compact Edition(3.5)和未安装的情况。当未安装SQL Server Compact Edition时,会出现以下错误:
Exception :Attempted to read or write protected memory. This is often an indication
that other memory is corrupt.
Inner Exception :
========================
Stack Trace :
========================
at System.Data.SqlServerCe.NativeMethods.CloseStore(IntPtr pSeStore)
at System.Data.SqlServerCe.SqlCeConnection.ReleaseNativeInterfaces()
at System.Data.SqlServerCe.SqlCeConnection.Dispose(Boolean disposing)
at System.Data.SqlServerCe.SqlCeConnection.Finalize()
Source :
========================
System.Data.SqlServerCe
----------------------------------------------------------
我正在使用这种方法来处理未处理的异常。
我从一个Windows表单启动的控制台应用程序中得到了这个错误。在两个应用程序中,我都插入了未处理异常编码,并且它已经被执行并返回到文本文件中,Microsoft的“报告错误”对话框也已经生成了;如何防止这种情况发生?如何排除导致此问题的原因?