ojhawkins
ojhawkins

Reputation: 3278

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 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

Upvotes: 5

Views: 6194

Answers (3)

Stachu
Stachu

Reputation: 5857

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!

Upvotes: 3

Sam Harwell
Sam Harwell

Reputation: 99879

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.

Upvotes: 4

ChaiNavawongse
ChaiNavawongse

Reputation: 199

Do you have any anti-virus software running? My work laptop has McAfee and it tries to scan just about every files. Next time it happens, check the task manager to see what hogging all the resources.

Upvotes: 2

Related Questions