Visual studio that won\'t be repaired...
Everytime I want to compile an app on vs 2015 - it crashes. Even if I want to compile the main function or writ
You can also try closing VS, deleting the bin
directory then attempting to debug again – it has worked for me.
I found this SOF article and tried everything listed.
And I found a new caveat to this voodoo.
Mine falls under the "the dumbest reason ever" category.
My temp folder was "full". So I did a disk clean up, and that deleted the FILES. However, I had a large amount of subfolders in my temp folder and while they were empty, the folders themselves were causing GetTempFile functions to fail.
So when I ran
"C:\blah\blah\blah\IDE\devenv.exe" /log
the log entries in ActivityLog.xml were showing something like this:
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)
In that log entry text, don't miss the text "System.IO.Path.InternalGetTempFileName"
So several places said "delete your temp files", which I did, but I still got the same issues. :(
Then I took a look at the temp directory, and I saw something weird. A large amount of (empty) subfolders.
So once I discovered I had a bunch of subfolders in my temp directory, I cleaned up these subfolders.
I found this question:
How to delete files/subfolders in a specific directory at command prompt in Windows
So I used this code:
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
And now my Visual Studio is running ok again.
Wow, go figure.
Click on Tools menu > Import and Export Settings > Reset all settings > Next > "No, just reset settings, overwriting all current settings" > Next > Finish.
if you're using windows 10. Try installing VS2015 update 3
https://docs.microsoft.com/en-us/previous-versions/mt752379(v=vs.140)?redirectedfrom=MSDN