I recently ran into a problem where I was getting the error:
Microsoft Visual Studio XAML UI Designer has stopped working
I first noticed this problem when I was working on a existing WPF project (VS2012), so naturally, I created a brand-spanking-new project to see if it persisted.
It did.
The top of the stack trace for the new project was:
1 2 3 4 5 6 |
Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteException Object reference not set to an instance of an object. at Microsoft.Expression.DesignSurface.View.SceneView.TextEditor_CaretPositionChanged(Object sender, EventArgs e) at Microsoft.Expression.DesignSurface.TextEditorContext.CaretPositionChangedPipe(Object sender, EventArgs args) at ... |
However, the stack trace for the existing project was different:
1 2 3 4 5 6 7 8 9 |
System.IO.IOException The file exists. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.__Error.WinIOError() at System.IO.Path.InternalGetTempFileName(Boolean checkHost) at System.Windows.Input.Cursor.LoadFromStream(Stream cursorStream) at System.Windows.Input.Cursor..ctor(Stream cursorStream) at ... |
I was also getting this pop-up when I would first start Visual Studio (2012 & 2010).
Checking the ActivityLog.xml file here is what I got for my error:
1 2 3 4 5 6 7 8 9 |
System.IO.IOException: The file exists. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.__Error.WinIOError() at System.IO.Path.InternalGetTempFileName(Boolean checkHost) at System.Windows.Input.Cursor.LoadFromStream(Stream cursorStream) at System.Windows.Input.Cursor..ctor(Stream cursorStream) at ... |
Looks familiar, but…
…what do I get from this?
The only clue that I had was on line 4 of the trace.
1 |
at System.IO.__Error.WinIOError(Int32 errorCode, String <span style="color: #ff0000;">maybeFullPath</span>) |
Well it turns out that
MSDN
The thing is, my C:\Windows\Temp folder was empty!
Here is what MSDN failed to mention:
I needed to check my Users\<user>\AppData\Local\Temp folder! Once I cleared it I was good to go!
I hope this saves someone else from wasting some much appreciated coding time!