Visual Studio 2017 is too slow during building and debugging

Visual StudioPerformanceVisual Studio-2017

Visual Studio Problem Overview


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

Visual Studio Solutions


Solution 1 - Visual Studio

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

Solution 2 - Visual Studio

There can be solution with priority..

  1. Disable Diagnostic Tools

enter image description here

  1. Disable rick client visual experience

enter image description here

  1. Disable all sync setting.

enter image description here

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

Solution 3 - Visual Studio

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

Solution 4 - Visual Studio

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!

Solution 5 - Visual Studio

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

Solution 6 - Visual Studio

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.

Solution 7 - Visual Studio

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)

Solution 8 - Visual Studio

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

Solution 9 - Visual Studio

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

Solution 10 - Visual Studio

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.

Solution 11 - Visual Studio

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

Solution 12 - Visual Studio

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser5871859View Question on Stackoverflow
Solution 1 - Visual StudioMurat YıldızView Answer on Stackoverflow
Solution 2 - Visual StudioRohitView Answer on Stackoverflow
Solution 3 - Visual StudioKohinoor BasuView Answer on Stackoverflow
Solution 4 - Visual StudiooopsdazieView Answer on Stackoverflow
Solution 5 - Visual StudioHooman BahreiniView Answer on Stackoverflow
Solution 6 - Visual StudioAkashView Answer on Stackoverflow
Solution 7 - Visual StudioAmir HajihaView Answer on Stackoverflow
Solution 8 - Visual StudioRachit PatelView Answer on Stackoverflow
Solution 9 - Visual StudioStephen HoweView Answer on Stackoverflow
Solution 10 - Visual StudioelrobisView Answer on Stackoverflow
Solution 11 - Visual StudioFabioView Answer on Stackoverflow
Solution 12 - Visual StudioJean JimenezView Answer on Stackoverflow