Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Visual Studio take so long to add a project or file

It takes about 5 minutes to add a new project to a solution & roughly the same to add a class in Visual Studio.

The time is mainly waiting on the dialogue window to open.

I saw this solution for deleting files Delete File VS, is there a similar solution for what I am experiencing?

Edit:

  • I experience this in VS 05, 08, 10
  • The source control is TFS (solutions are brought locally, I assume this is implied)
  • I have Mcafee software encryption
  • My dev PC is a fast new business machine.
  • No resharper
  • Reflector installed
  • SQL Prompt installed

I have debugged Visual Studio, and have found each time is tries to add an item it load all the symbols from the below directories which contain dll's. I have tired deleting all the data in this folder but it comes back next time add something.

It appears the bulk of the time is spent loading the symbols...

enter image description here

like image 330
ojhawkins Avatar asked Aug 09 '13 02:08

ojhawkins


2 Answers

The answer to this is highly dependent on the version of Visual Studio you are using, the language you are using, and the particular build configuration your project is using. I would need to see all three, as well as your system hardware and software configuration to give you the precise cause.

However, based on the absurdly long time you listed (5 minutes), I predict that you are facing one of the following problems:

  1. Your build configuration requires certain build steps be run the first time the project is loaded, and the build is taking a long time.
  2. Your machine uses exceptionally out-of-date hardware, or has no available memory and is operating from a page file.
  3. One or more of your projects is bound to source control, and the source control provider in Visual Studio and/or the server it's connecting to are running slowly. Try unplugging your computer from the network (or disabling your wireless card) and adding a project again. This will cause the source control connection to fail immediately so if adding a project becomes fast then you found the problem.
like image 151
Sam Harwell Avatar answered Nov 15 '22 05:11

Sam Harwell


Here's a weird solution that somehow fixed my problem (same problem):

  1. Open instance of VS in safe mode, then open project. Everything went fine here, except it asked if I wanted to unbind my source control. (Don't do this.)
  2. Close that instance.
  3. Open a normal instance and run normally.

No idea why this worked, but it did!

like image 45
Stachu Avatar answered Nov 15 '22 05:11

Stachu