Today I was getting an error when running Visual Studio.
<source>Editor or Editor Extension</source>
<description>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 Microsoft.VisualStudio.Text.Editor.Implementation.LeftSelectionMargin.get_RightArrowCursor() at Microsoft.VisualStudio.Text.Editor.Implementation.LeftSelectionMarginProvider.CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin) at Microsoft.VisualStudio.Text.Utilities.ContainerMargin.<AddMargins>b__2(IWpfTextViewMarginProvider mp) at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InstantiateExtension[TExtension,TMetadata,TExtensionInstance](Object errorSource, Lazy`2 provider, Func`2 getter)</description>
So I internet searched and found several articles that suggested my “Temp” folder(s) were full.
No problem, right click C:, properties and do some clean up and delete Temp items.
I still was getting the error.
The issue was that while cleaning up “Temp” gets rid of files, it does not seem to get rid of subfolders. And subfolders (with no files) still take up space.
So I found this StackOverFlow article:
I put this code in a .bat file
del /q “C:\Users\MYUSERNAME\AppData\Local\Temp\*”
FOR /D %%p IN (“C:\Users\MYUSERNAME\AppData\Local\Temp\*.*”) DO rmdir “%%p” /s /q
Now my Visual Studio starts normally. Apparently, I had a BUNCH of (empty) subfolders in my temp path.