Csharp/C#教程:VS 2012/2013 AccessViolationException分享


VS 2012/2013 AccessViolationException

当我运行项目(F5)时,我在IDE中收到以下exception:

An unhandled exception of type 'System.AccessViolationException' occurred in System.Windows.Forms.dll Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. 

堆栈跟踪报告

 at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at System.Windows.Forms.Control.SendMessage(Int32 msg, Int32 wparam, IntPtr lparam) at System.Windows.Forms.Form.UpdateWindowIcon(Boolean redrawFrame) at System.Windows.Forms.Form.CreateHandle() at System.Windows.Forms.Control.get_Handle() at Microsoft.VisualStudio.HostingProcess.HostProc.RunParkingWindowThread() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() 

我没有注意到在没有调试器(CTRL + F5)的情况下运行时收到相同的exception。 这是一个WPF项目,但在执行App_ctor之前发生exception,因此这是外部代码,我的应用程序代码没有开始执行。 偶尔会发生这种情况,有时它只发生一次,有时我会运行项目并在滚动中多次获得此消息。 然后它不会弹出5-6次运行,然后再次启动。

谁知道为什么会这样? 我刚刚安装了干净的W8.1 64位,VS2013和TFS 2013(虽然我遇到了与W8和VS2012相同的问题,但并不常见)。

此问题似乎在dot net framework update(4.5.2)中得到修复。 https://connect.microsoft.com/VisualStudio/feedback/details/819552/visual-studio-debugger-throws-accessviolationexception

上述就是C#学习教程:VS 2012/2013 AccessViolationException分享的全部内容,如果对大家有所用处且需要了解更多关于C#学习教程,希望大家多多关注—计算机技术网(www.ctvol.com)!

本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

ctvol管理联系方式QQ:251552304

本文章地址:https://www.ctvol.com/cdevelopment/984895.html

(0)
上一篇 2021年12月20日
下一篇 2021年12月20日

精彩推荐