Visual studio 2013 often crashes when I use drag and drop functionality in winforms designer, like adding a new control, resizing controls, or just click on a control in order to see/change properties of the control. OS - Win 7x86, verson of VS - VS2013 ultimate 12.0.21005.1 rel. I tried to run VS as an administrator, but it still crashes almost all of the time when I use drag and drop functionality.
I debugged VS with the help of the second instance of VS(attached to a first VS process), here is the result: (i run it many times, it looks like that it throws 3 different kind of exception)
An unhandled exception of type 'System.InvalidOperationException' occurred in System.Drawing.dll
Additional information: Object is currently in use elsewhere.
> System.Drawing.dll!System.Drawing.Image.RawFormat.get() Unknown
System.Drawing.dll!System.Drawing.Graphics.DrawImage(System.Drawing.Image image, int x, int y) Unknown
System.Design.dll!System.Windows.Forms.Design.Behavior.DesignerActionGlyph.Paint(System.Windows.Forms.PaintEventArgs pe) Unknown
Or the same exception but different call stack:
> System.Drawing.dll!System.Drawing.Graphics.FillRectangle(System.Drawing.Brush brush, int x, int y, int width, int height) Unknown
System.Drawing.dll!System.Drawing.Graphics.FillRectangle(System.Drawing.Brush brush, System.Drawing.Rectangle rect) Unknown
System.Design.dll!System.Windows.Forms.Design.Behavior.SelectionBorderGlyph.Paint(System.Windows.Forms.PaintEventArgs pe) Unknown
Another exception:
An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
Additional information: Exception has been thrown by the target of an invocation.
> mscorlib.dll!System.Delegate.DynamicInvokeImpl(object[] args) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.InvokeMarshaledCallbackDo(System.Windows.Forms.Control.ThreadMethodEntry tme) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(object obj) Unknown
And the last one:
An unhandled exception of type 'System.AccessViolationException' occurred in System.Drawing.dll
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
> System.Drawing.dll!System.Drawing.Graphics.FillRectangle(System.Drawing.Brush brush, int x, int y, int width, int height) Unknown
System.Drawing.dll!System.Drawing.Graphics.FillRectangle(System.Drawing.Brush brush, System.Drawing.Rectangle rect) Unknown
System.Design.dll!System.Windows.Forms.Design.Behavior.SelectionBorderGlyph.Paint(System.Windows.Forms.PaintEventArgs pe) Unknown
ETA: @GRUNGER 's answer helped, but what was the problem then?
It crashes even in a new empty project.