96
votes

I have just installed Visual Studio 2017 on a PC having the following specifications:

Intel Xeon E5-1600 v3 @ 3.50 GHz processor, 16 GB RAM and Windows 10 Pro 64-bit operating system.

Although the PC performance is almost perfect, I usually encounter slowness problem in Visual Studio 2017 especially during build and debug processes. In addition to this sometimes I need to restart it after "Not responding" message.

Is there a stable solution regarding to this problem for Visual Studio 2017?..

12
Is "lightweight solution load" enabled? It was slowing my sln build ~ 2x timestukaef
@2kay Where is that setting?user5871859
@hexadecimal right-click on sln -> enable / disable lightweight solution loadtukaef
@2kay It was disabled, thanks...user5871859

12 Answers

170
votes

In order to obtain a better performance in Visual Studio 2017, some kind of Performance Tweaks can be applied as shown below:

  1. Set Current source control … to None under ToolsOptionsSource Control

  2. Uncheck Synchronized settings across ... option under ToolsOptionsEnvironmentSynchronized Settings (for some versions: ToolsOptionsEnvironmentAccounts)

  3. Disable CodeLens (Optional): Uncheck Enable CodeLens option under ToolsOptionsText EditorAll Languages

  4. Disable Diagnostic Tools (Optional): Uncheck Enable Diagnostic Tools while debugging option under ToolsOptionsDebuggingGeneral

  5. Clean the contents in the following folders (do not delete these folders, instead delete their contents only) and restart Visual Studio:

    Clean the content in WebSiteCache folder (can be found in
    C:\Users\%USERNAME%\AppData\Local\Microsoft\WebSiteCache)

    Clean the content in Temporary ASP.NET Files folder (can be found in
    C:\Users\%USERNAME%\AppData\Local\Temp\Temporary ASP.NET Files)

Note: If you have Hardware Acceleration enabled or if you use the default Visual experience settings in Microsoft Visual Studio 2017 or Visual Studio 2015, you might experience intermittent performance issues, product crashes, or rendering issues. In order to work around these issues, apply the following settings under ToolsOptionsEnvironmentGeneral

enter image description here

For more information, visit You experience performance issues, product crashes, or rendering issues in Visual Studio 2015 and Visual Studio 2013.

If the problem is related to debugging, try the workaround on Visual Studio debugging/loading very slow.

I hope this helps...

9
votes

There can be solution with priority..

1) Disable Diagnostic Tools

enter image description here

2) Disable rick client visual experience

enter image description here

3) Disable all sync setting.

enter image description here

also make sure you removed the cache by using run -> %temp%. good luck.

6
votes

My problem was with Lightweight Solution Load. Once I disabled that everything went back to normal.

3
votes

I got this link to Manage Visual Studio Performance in my VS 2017

Note: You can also open this window from: Help -> Manage Visual Studio Performance

According to the screenshot below, Developer Analytics Tools adds 5 sec (on avg) to Solution Load time. I have disabled it.

enter image description here

2
votes

I have tried all the above solutions, and followed many of the relevant links. None of them worked.

After pulling off all my hair, and filling up another cup of coffee, I decided to update Visual Studio 2017. Boom, everything is back to normal now (except for my hair and a caffeinated brain).

So, if you ever encounter the same issue, I suggest you to check your Visual Studio 2017 update first. If there is any available update, update!

2
votes

Download procmon and run to check the background activities done by msbuild or visual studio. Visual studio can be extremely slow or almost unusable in case its writing log using fuslogvw.

Steps to stop fuslogvw log writer.

1) Window+R, type RegEdit 2) GoTO path HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion 3) Set hexadecimal value of Force Log to 0.

Visual Studio will start performing normal.

2
votes

I am running VS 2017 on a system that has 128GB of RAM and 4 Quad Core Xeon Processors with SSD. I am of course using Windows 10 Pro for Workstations in order to support my quad CPU build.

What really helped me to decrease my build time to less than 2 seconds was this simple trick:

Setting the Host computer's setting to optimise on "Background Services" using Windows' properties, Advanced System Settings, Advanced, Advanced tab.

Also, considering that I have huge amount of RAM and I have never seen even a quarter of it being used was to disable Page file. (Windows will warn about the consequences)

Also, it is worth adding VS installation and project folder to a list of exceptions in the anti-virus settings (In my case, Windows Defender)

1
votes

I observed that “perfwatson2.exe” process use highest utilization of CPU/Memory/Disk while build VS 2017. perfwatson2 process collects data of system action which takes more time (around 2+ seconds) and send those data to Microsoft. Microsoft team can analyses the data and find solution for same.

Below steps will help you to stop perfwatson2 service/process.

Open VS2017 and go to Help => Send Feedback => Settings and set No, I would not like to participate option

enter image description here

1
votes

After trying all of the above suggestions I was still having issues. My fix was to clear NuGet Cache.

Tools-Options-Nuget Package Manager-General

0
votes

I had a similar problem with the VS Community version 2017 and I disabled the "Enable Diagnostic Tools while debugging", only it, nothing more...!!!

Tools> Options> Debuggin> General> Enable Diagnostic Tools while debugging

0
votes

Try deleting the .vs folder that VS2017 creates in the local code repository. Then open the solution again.

0
votes

Wild ..I still had a build issue (VS 2017 seeming to hang on "importing project references..") after following some steps in the accepted answer.

Out of ideas, I ran "Clean Solution", then I closed Visual Studio, then relaunched the project from the .sln file ...and suddenly it was building fine.

Unreal. Hopefully this helps someone.