Visual Studio Code crashes on Windows 11/10

0

Visual Studio code by Microsoft is arguably one of the best IDEs for coders. It supports multiple languages ​​and has a plethora of extensions you can install in addition to a feature-rich coding setup. However, things have not been that easy for many programmers because VS Code on their computer continues to crash. Therefore, in this article, we will see how to fix your Visual Studio code crashing issue on Windows 11/10.

Fix Window crashed error in VSC

Why is Visual Studio Code crashing on my computer?

Users are faced with two scenarios, VSCode crashes as soon as it is opened or crashes in the middle of a project. Now there can be several reasons for this particular behavior like corrupted file, infinite loop etc. We will talk about all possible solutions in detail.

Visual Studio Code crashes on Windows 11/10

These are the things you can do to fix Crashing or crashing Visual Studio Code problem on Windows 11/10.

  1. Update graphics driver
  2. Disable hardware acceleration
  3. Delete backup of open files
  4. Reinstall the VS code

Let’s talk about it in detail.

1]Update the graphics driver

The first thing to do to correct the error is to update the graphics driver. An outdated graphics driver will not allow you to run games or programming applications, and they can end up crashing on your system, especially if your program is long. Therefore, update your outdated driver and see if the problem persists.

2]Disable hardware acceleration

Then, if the problem persists, try disabling GPU hardware acceleration. This way, VSCode will only use software rendering, which will result in a much more stable experience. To do this, follow the given steps.

  1. Open Visual Studio code on your system.
  2. Hit Ctrl + Shift + P to open the command palette.
  3. Type ‘Preferences: configure runtime arguments‘and press Enter.
  4. Now add the following command and save the file (Ctrl + S).
"disable-hardware-acceleration": true,

Finally, restart VSCode and then see if the problem persists.

3]Delete backup of open files

If while opening a large file, VSCode crashes and then crashes, you need to delete some files. So open Run, paste “% AppData%” and click OK. Open Code> Backup then delete the only folder that is in that directory. Finally, restart VSCode and see if the problem persists.

4]Reinstall the VS code

If nothing works, the problem may be due to a corrupted VSCode file. So to fix the problem, you need to uninstall VSCode and then re-download and reinstall a fresh copy of the software to see if the problem persists.

Hope you can solve the problem with the given solutions.

Infinite loop causing VSCode or system to crash

Sometimes there may not be any problem with the application or your graphics driver, but still your VSCode crashes, or sometimes even your system crashes because of it. This scenario could be caused by your implementation of an infinite loop.

If you know that you are using the infinite loop, then you need to know the consequences, that is, your computer may crash if you fail to stop the process. However, sometimes we unwittingly write an infinite loop.

The infinite loop is nothing more than a loop which has no conditions that can end the process. For example, look at the following code.

int x; 
for (x = 4; x>4; x++)
{
//some code
}

In this case, since the condition, that is to say; x> 4, will always be satisfied, therefore the loop will never end.

So make sure that you don’t inadvertently use Infinity Loop. If you accidentally wrote such a loop, keep an eye on the output, as soon as you see a series of unwanted outputs just end the process Ctrl + Alt + M.

This way you can stop the code and prevent your computer from crashing.

Read more :

Visual Studio Code crashes on Windows 11/10


Source link

Leave A Reply

Your email address will not be published.