Why is Visual Studio constantly crashing?
Asked Answered
F

11

32

Visual Studio randomly crashes when adding/removing references and projects. Any thoughts why? Will installing Sp1 help?

EDIT: I do not work with any addons except SourceSafe. I do most of my development in connected mode.

Developing using:
Visual Studio 2008
WinXp Terminal Service -> Win2k3 Sp2 (64bit)
VSS 8.0, 32bit

Flaherty answered 18/9, 2008 at 20:47 Comment(0)
C
60

Try deleting your .user and .suo files - these are the user options files that VS creates. You get a .user file for each project and a .suo file for your solution. When they get corrupted, odd things happen. Deleting them will make you lose little things like which project is selected as the startup project when you start debugging, but it usually clears up odd behavior like this.

You may also want to clear out any temporary file locations, like the Temporary ASP.NET Files folders (if you're working in ASP.NET) just in case something odd is being cached somewhere.

Carbarn answered 18/9, 2008 at 20:59 Comment(2)
Where are those .user and .suo files located?Brott
You'll see them alongside your .csproj and .sln files. In VS 2015 many of these went into a .vs folder by your .sln file.Carbarn
I
11

My Visual Studio 2005 started crashing and locking up recently. The way I finally fixed it was to run this from the command line:

devenv /resetuserdata

That cleared out all my customisations, but it did fix the problem. If you've customised VS a lot, you could try exporting your settings first and then see if you can safely import them afterwards. Alternatively, take snapshots of your IDE so you can remember which buttons etc. you had where.

Iridectomy answered 24/11, 2008 at 16:51 Comment(0)
C
10

Most commonly, if Visual Studio is crashing repeatedly, your .suo or .ncb file has become corrupted. Close your project, delete those files, and reopen. This may resolve your problem.

.suo is a hidden file.

Concentre answered 18/9, 2008 at 21:0 Comment(0)
T
2

Beware if you suspect a corrupt .suo file and are integrated with Source Safe.

When you restart VS after a crash, you may get the following message:

The Open from Source Control operation is still in progress but you can start working now. the rest of the projects will be retrieved asynchronously.

This basically means VS will load all projects in your opened solution from Source Safe and Overwrite any files that are checked out and contain unchecked-in changes!
After a VS crash, start Source Safe standalone and CHECK IN what you want to preserve.
Then work at fixing the corruption before starting VS again.

Tybalt answered 15/2, 2013 at 2:42 Comment(0)
W
2

If .suo or .ncb file has become corrupted, that causes for visual studio crashing also. To solve this crashing you can use the following step as mentioned in the image.

  1. Go to the folder that contain visual studio execution file(devenv.exe).
  2. open the command prompt with the folder path mentioned in the step one and run the command devenv.exe /ResetSettings.
  3. If step two doesn't solve your problem then run the command devenv.exe /ResetUserData.

enter image description here

Wheresoever answered 29/8, 2017 at 4:56 Comment(0)
H
1

Hopefully this helps someone. It felt like I had tried everything. I even repaired the installation, which made no difference as well as removed VS entirely and the issue was still there. The log option told me nothing significant, so I eventually deleted all the bin and obj folders in my solution as well as all the .suo and .user files and moved it to a completely different folder off the root folder on my harddrive and rebuilt it. It magically came right!

Henbane answered 1/7, 2015 at 8:36 Comment(0)
S
0

Search for and delete any .ncb files associated with your solution. In past versions these (debugging) files used to get corrupt and deleting them would fix the problem (Visual Studio will regenerate them automatically).

Stateroom answered 18/9, 2008 at 20:53 Comment(0)
B
0

I Find on mine even in SP1 that it crashes rarely when adding stuff to a project, but mainly when switching to an ASP.NET Design View and when it autogenerates controls in the tools. I just disabled it from creating them and i dont get many crashes any more.

I know this doesnt have much to do with your issue, but the point i am making SP1 may not be the answer to your problem.

Burnejones answered 18/9, 2008 at 20:54 Comment(0)
H
0

I tried all of the suggested options, and a few more found at this link. No luck.

Then I tried to add a reference from a Web Site (as opposed to Web App). The process is different: you have to right click the project and go to Property Pages, and there's an Add... button on the References tab.

It still crashed, but there was a message in the Event Viewer this time that pointed me to the full path of a DLL in a 3rd party component I have installed. The DLL couldn't be read from disk (corrupt). So, a repair of that lib and a reboot later, and I'm back to good.

UPDATE:

I came to find out the real reason, several files on my SSD had become corrupt. CHKDSK /R got me back going for a while. Eventually had to replace the drive. Just a reminder that it may not be VS's fault.

Hanley answered 28/8, 2012 at 15:16 Comment(0)
F
0

changing the default solution location solved my problem.

Finite answered 21/1, 2016 at 0:39 Comment(0)
D
0

I had to remove older reference for the project that no longer existed from the solution and that worked fine for me.

Denaedenarius answered 9/3, 2017 at 18:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.