Closing Visual Studio Code Crashes the Program (Fixed)

To test out some Python code, I recently downloaded the Visual Studio Code or VS Code by Microsoft. The software works great as an IDE for Python (integrated development environment). However, I ran into a very strange problem. Every time I closed the program, it crashed! Yes, it literally crashed and wouldn’t start again. This article discusses how to prevent Visual Studio Code from becoming corrupt when the program is closed.

How to Prevent Visual Studio Code from Crashing

I am running VS Code on Windows 10. Here’s what happened. After using the software, when I clicked on the X button to exit, the software popped up a message stating, “Updating Code.” An error message would follow stating that the code could not be updated. This would corrupt VS Code completely. When I tried to start the program again, nothing would happen. Even after restarting, the program wouldn’t start. So, what I did was to download the setup file and reinstall the program in a different directory. Then it started working again. However, if I closed the program again, it would crash.

visual studio code crashes

So, what’s the solution to this bizarre problem for this sophisticated software?

It appears that, closing the program by clicking on X is the reason behind it crashing. If I closed the program by clicking on File > Exit, it would close fine without an error. And, that’s the solution to the problem.

visual studio code proper exit procedure

So, if your VS Code is not working at the moment, do the following:

Download the setup file from VS Code website and reinstall the program. But, you won’t be able to install it in the same folder as your existing setup. During the setup process, choose another folder, for example Visual Studio Code 2. This will make the program functional again. After that, remember to exit by going to File > Exit.

I hope Microsoft fixes this silly problem in their upcoming releases.

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top