Visual Studio 2022 keeps crashing and locking the system - visual-studio

I got a new laptop for Christmas, upto date with Windows 10.
Installed Visual Studio 2022 and so far it's been crashing every day several times a day. It could be either on the coding screen, the design view, or simply in a menu.
It just freezes the whole screen and the mouse stops and no keyboard responses work. I have to turn off the laptop via the power button.
It's happened about 15-20 times in the last few days. Any ideas?
It's Windows 10 Home, and 4GB RAM. No other programs crash it's only Visual Studio.
Thanks in advance
Mark.

I went back to VS 2019. No issues now.

It may be the antivirus. Following Eliot Jones' solution to exclude VsDebugConsole.exe worked for me:
Open the Windows Security app, then go to Virus & threat protection > Virus & threat protection settings Manage Settings > Exclusions Add or remove exclusions > Add an exclusion

i just using repair system visual studio installer, maybe too much extension installed impacted to you system performance, i do had 16gb , but after repair the vs22 never crash or freeze again

For some time now, my entire computer freezes when opening solution. In my case it seems to be caused by a corrupted .vs directory. Deleting this folder fixed the problem. Problems like these never happened in VS2019, I only started noticing them since I switched to VS2022.

I had this problem too and I solved changing the Visual Studio font.
Go to Tools->Options->Font and colors and change the default Cascade Mono font to Consoles
After that change zero crashes.

Related

Visual Studio - Designer process terminated unexpectedly

After opening project (new or old) Visual Studio shows warning "Designer terminated unexpectedly" (can see in the picture below). What could cause this error? And how to fix that?
I clicked "click here to reload the designer" and it shows the same error.
I had the same issue and found out that my Oracle VirtualBox causes the issue.
My Visual Studio runs in a virtual Windows 10 enviroment.
After I disabled "Enable 3D Acceleration" in options Display, my Visual Studio Designer worked fine again.
I just had a similar problem. Tried:
Clicking to reload the designer
Cleaning my solution
Restarting Visual Studio
Repairing Visual Studio
Uninstalling and re-installing Visual Studio!
It ended up being graphics related, as you mentioned.
I have hybrid graphics (Intel and NVIDIA), and was using NVIDIA for Visual Studio. Changed it to Intel and this worked.
If it helps, a screenshot of my NVIDIA control panel is below:
Before (broken):
After (working):
Some people have found a file "c:\program" that causes this, often created by typo creating a log file.
Check to see if this file exists, and if so, move or delete it.
Graphics card was the problem for me. I have an external USB video from DisplayLink and when I disconnected it the problems went away. in fact it didn't return when I reconnected the displaylink.
Start Visual Studio As Administrator~!
I had the same problem when i started working in Team Projects, so almost everything did not work including the designer, properties menu, debugging and so on.. (which is totally unusual for anything to cause all these problems except for Administrator Privileges issues probably in most cases).
Don't know why or what caused it, but at least it works.
In my case it was the problem with using system brushes as ThemeResource. Yes this is apparently a bug like other odd bugs in MS products. So I had to comment out them until I finished my project. I don't know, maybe another factor such as my graphic hardware was not ineffective but this does not exonerate MS.

Visual Studio crash at start-up

My Visual Studio began crashing at start-up. In my search for finding a remedy, I found these two suggestions, but neither worked for me:
Launching Visual Studio while running in safe mode, and
Running repair on Visual Studio.
However, I found that if I logged into a different Windows account, Visual Studio was able to run from that account without crashing.
Here is an error code that that I observed in the crash report:
LCID: 1033
Can anyone provide a solution for returning my Visual Studio to working order?
For me it turned out to be the plugin that GitExtensions installed into Visual Studio 2013.
-- UPDATE: try this before uninstalling GitExtensions
#Enceradeira proposed in the comments to uncheck the Show current branch in Visual Studio option. In GitExtensions, you get there via Tools -> Settings -> Appearance:
-- END OF UPDATE
After uninstalling GitExtensions and reinstalling it with all VS plugin unselected my VS runs smoothly again.
I even put together a blog post about this issue because it bugged me so much.
Since you're able to run with another user login, something may be wrong with your local settings, you can try to reset them: devenv /resetsettings in Start menu -> Run.
Warning: this will restore visual studio to default settings.
In my case VS used to crash on a single solution. I resolved the problem by deleting the respective solutions's user file: SolutionName.suo
My colleague recently experienced a problem with Visual Studio 2013 crashing on start-up. Unfortunately, we found that the approach recommended in the answer by #Arun M did not solve the problem:
devenv.exe /ResetSettings
...however, using a different command line argument did:
devenv.exe /ResetUserData
An easy way to run devenv.exe is via the Visual Studio command prompt; on Windows 10, it can be found here:
Start Button => All Apps => Visual Studio 2013 => Visual Studio Tools =>
VS2013 x86 Native Tools Command Prompt
For more about these command line arguments for devenv.exe, see this answer to this related question: How do I truly reset every setting in Visual Studio 2012?. ⚠ In particular, please note the cautionary statement in that answer about the /ResetUserData command line argument!
Try to run VS as administrator. That's necessary in my case.
If coincident to these Visual Studio crashes you are getting "Heap corruption" (Exception code: 0xc0000005) errors in your Windows Application log (Faulting module name: WindowsCodecs.dll), here is something worth checking into: A faulty WIC component within Expression Blend can cause ALL versions of Visual Studio to crash upon launch, as well as cause Internet Explorer to crash upon visiting many, if not most sites. Even though Microsoft distributes this component, they call it a "non-Microsoft component". As such, a Visual Studio reinstall won't fix this,, an OS reinstall over existing Windows installation won't fix this, and a system file integrity check won't detect it.
If my case, the misbehaving codec was "C:\Program Files (x86)\Microsoft Expression\Common\Imaging\4.0.360.0\PSDCodec.dll", and simply unregistering this component got my Visual Studio working again from consistent startup launch crashes.
I post this in hopes this solution to one source of Visual Studio crashing might save others from the $500 Microsoft support incident fee and week of downtime this caused me.
I just changed the windows language in the bottom right to "EN", then started as admin. And it worked, interesting..
I had the very strange phenomenon that both Visual Studio 2010 and 2013 on a Windows 7 machine crashed when run in a remote desktop session, started from a Windows 10 pc. Debugging the crash showed a CultureNotFound exception. It was caused by regional settings on the Windows 10 pc, which could not be translated in something understood by Windows 7. I had language English(Belgium) with an Azerty keyboard. I added and selected English(UK) with an Azerty keyboard and the crashes disappeared. No other programs suffered from this.
For me it was being caused by Web Essentials and I was able to resolve by disabling it, restarting VS, enabling it back , restart again. Works now.
I had a crash on startup (or soon after startup, before opening any solution) occurring in git2-msvstfs.dll, caused by placing a 3GB temp file into a directory within my solution. Deleting the file fixed it.
Once I accidentally pressed a random key combination (maybe something like ctrl+', but I didn’t realize I was holding ctrl down so I forgot what keys I hit by the time I realized something bad had happened) that resulted in VS Professional 2017 15.3.5 crashing within half a minute. After relaunching, I found that VS would be interactive for a few seconds before it would crash within half a minute. It was really too fast for me to try to figure out what I had accidentally activated or for me to disable it before VS would crash. Also, it would even crash if I didn’t open any solution, so I figured it was not something that deleting a .vs (per project/solution Solution Explorer/open files state) folder would fix.
To fix, I followed Arun M’s comment and renamed my %LOCALAPPDATA%\Microsoft\VisualStudio\15.0_3f4d04be folder. You will need to adjust the path for the edition/version of VS that is crashing. On my machine, I think 15.0_3f4d04be is Professional and 15.0_0fed6c59 is VS Community Edition. You’ll probably have to guess based on the folder’s modification timestamp which is probably going to reflect the date you last used that edition of VS.
After renaming the versioned dotfolder, VS launched without crashing. It started with default settings but automatically restored some of my settings through the cloud sync stuff after a minute of running and it even remembered my account information so I didn’t need to sign in.
I did not need to rename my %LOCALAPPDATA%\Microsoft\VSCommon folder (which Arun M had also suggested).
I had a similar problem, both VS2015 and VS2013 would crash at startup. Tracked it down to an application I installed which put .net 4.7.2 on the system. Once i removed that app, removed .net, and reinstalled .net 4.6, Visual Studio started working again.

Scrolling in Visual Studio causes text to become unreadable

Since the past week I'm having a very bothering issue that blocks me from using Visual Studio.
For instance, here's what I normally see:
But as soon as I scroll a bit down (either with the arrow key, mouse wheel or the scroll bar), this is what I get:
As you can see, part of the frame seems to be "locked" in the screen.
The only way to see it right, is to make some other window cover VS's window, then going back to VS I see it right.
This is what I have tried (checking if the issue was solved after each step):
Check for updates
Repair VS2010
Remove R# and any other extension/add-in
Reinstall R# and any other extension/add-in
Remove VS2010 and any related software
Reinstall VS2010 + SP1 and updates
Remove any other unused software
Remove any recently installed/updated software
Run CCleaner
None of these steps solved the issue.
This happens only with VS2010, regardless the project or solution I'm opening.
I think you need to start looking beyond Visual Studio for issues. The next thing I'd look at is your graphics driver. Make sure you have the latest available version.
I have the same problem with VS 2012.
Scrolling up and down, does not refresh sections (rectangles) on my text editor view.
(unfortunately I've not enough reputation to post a screenshot.)
I managed to workaround it in VS 2012, by floating the editor.
i.e. Right Click on a file tab / Float All.
Otherwise I tried everything posted here, without any luck.
Hopefully someone out there knows how to undo this magic.
I had the same problem and it was due to the DameWare Development Mirror Driver.
I disabled it and the problem went away.
I'm having the same issue in VS 2015 pro.
Setting the editor windows to float fixes the problem which definitely looks like a bug in visual studio.
I'm on a Citrix virtual Desktop and the problem appears to be that a "column" of the editor (on the left side) is not redrawing properly after scrolling right, left, or down. For some reason scrolling up is fine.
For me, using VS 2013 Pro, the cause was having the JAWS Screen Reader installed, which, ominously, included a video interceptor. Once uninstalled VS started working normally again.
I had this same problem and it turns out it wasn't a graphics driver issue. The company I work for uses software that acts like a virtual monitor to remotely log into our PCs to install software and fix problems. It turns out that this extra virtual monitor was the problem. Disabling it fixed the scrolling in Visual Studio.
I had the same problem in Visual Studio 2017. When I changed the color theme to 'dark' the problem seemed to be fixed

Visual Studio 2010 (devenv) Hung Process After Closing

I have problem with Visual Studio 2010 on Windows 7 64-bit. After some time of work VS starts consuming ~50% CPU and UI responding slows down. When I close VS then UI disappear but process stay.
When I forgot to kill those hung processes at the end of day, I will end up with numerous devenv.exe processes.
I have reinstall Visual Studio and reinstall Windows and ended up with the same problem... doesn't change anything. Please help. :/
Remove and/or uninstall all third-party Visual Studio add-ins and extensions. Disabling is not good enough.
Visual Studio 2010 relies heavily on graphics. Therefore:
Update your video driver.
Turn off "Enable rich client visual
experience"
Turn off "Use Hardware graphics acceleration if
available"
There are also temporary files that Visual Studio uses that may need to be cleared out.
Clear out your %temp% folder.
Clear out %AppData%\Local\Microsoft\WebsiteCache
Clear out %AppData%\Local\Microsoft\VisualStudio\10.0\ProjectAssemblies
Your project and solution user settings may be corrupt due to so many "crashes".
Delete .user and .suo files (you will lose the startup project, bookmarks, breakpoints, and other user settings specific to projects and solutions.)
Begin where you began before - it may seem overkill but this is the only way to be sure we are addressing everything short of hardware issues.
Reinstall Windows - make sure you are using a validly licensed copy, and patch the hell out of it before installing Visual Studio.
Note: I doubt it is a GPU driver issue, but it never hurts to use the most up to date driver and this is the place to do it right after a fresh OS install.
Install Visual Studio .Net 2010 but do not start it up. Let it get the frameworks installed fresh.
Use Windows Update to install the VS 2010 SP1 patch, and any/all patches for .Net frameworks.
Make an images for yourself right here so you have something to build from if you need to try this again. It will save you lots of time.
Fire up Visual Studio, and test your closing before installing anything else.
If it does not work here, there's likely some conflict between PC hardware and window OS, and you should try to find this symptom in other applications to get more info.
Here's what i would be looking for:
Does it happen EVERY TIME?
Does it happen after you debug your project ? does it happen for ALL projects?
Does it also happen when you don't load any projects? (simply start the IDE and wait).
Does it happen after a debug session of your application? maybe the application is not closed properly?
Do you have any other apps running at the same time that may cause this? try reproducing with a minimal set of apps/services running.
What are you doing exactly when it starts freezing ? anything in particular?
I would try to get 2-3 memory dumps at the time of hanging, post it here as well as to MSFT people. That would be a good start.

Starting Visual Studio causes all running apps to hang and stop responding

After my laptop fell on the floor and its screen was a little damaged, I was able to continue working with it, but failed to build a project of mine. At some point, the system froze, and I was forced to restart the laptop. Ever since, I’m not able to start Visual Studio 2008 or 2010. Moreover, when I do try to start one of the versions, I see no splash screen, and at some point, all running applications stop responding, and I’m forced to restart the laptop.
When I started Visual Studio 2008 with the /SafeMode flag it started OK and worked perfectly, but when I tried it with Visual Studio 2010, I did see a splash screen and the application main window was opened, but then the system got stuck again and forced me to restart.
I use Windows XP SP3, and the addins I recall I have are Visual Assist, IncrediBuild, and Productivity Power Tools for VS 2010 (how can I check what other addins are installed without having Visual Studio running?)
I tried using the /Log flag to find out what’s happening, but there was nothing that seemed related in the generated log.
At the time of the hang, the CPU and memory of the system was low.
The problem happens whether I open Visual Studio with no solution, or with an existing solution.
Do you have any idea why this might happen, or how it can be solved?
Edit:
I run chkdsk /R /V and it is stuck on "1 percent
completed." for hours now. Is there anything I can do?
I'll try to re-install Visual Studio 2010 next week, when I'm in the office. I hope that will help.
Thanks a lot,
splintor
Your drive is torched. Buy a new drive, and salvage whatever you can from the existing drive, then swap them out. If you're lucky you can salvage enough of the existing drive to not need to do a full OS reinstall, but it's likely you're going to need to do some reinstallation.
Looks like the cause if the fall of your laptop. Though what changes happened is unknown it is more likely to be a hardware issue.
Did you reinstall the softwares and check how they work.
If I was diagnosing this issue, I would start from the ground up.
Start of with a basic CheckDisc - CheckDisk Instructions for XP
Progress from that to try re-installing over your existing VS install.
I can't see it being a software problem, so I reckon the checkdisk will discover/fix something, or a reinstall should resolve it.
Dave
You've probably damaged your hard disk in an area which is touched by VS. Windows often grinds completely to a halt when it's struggling to read a damaged area of disk.
Check the Windows event log for errors to do with disk drives.

Resources