Visual Studio Build Very Slow

前端 未结 20 1531
别那么骄傲
别那么骄傲 2020-12-12 10:59

This applies to both 2008 and 2010 versions (and probably earlier ones too). Also to both C++ and C# projects.

An initial build (after reboot) runs at normal speed

相关标签:
20条回答
  • 2020-12-12 11:30

    As a quick check, run a scan to make sure you don’t have anything currently infecting your system, and then go to Windows Defender Security Center-> Virus & threat Protection -> Disable Real-time protection:

    real-time-protection

    Rebuild your solution in Visual Studio, noting the total time it takes and observing in Task Manager to see if the Antimalware Service Executable appears to be consuming significant processor time. Assuming your build is faster and your CPU less busy, congratulations, you’ve identified one cause of your performance problems. The next step is to responsibly tell Windows Defender to leave Visual Studio alone without turning it off completely.

    0 讨论(0)
  • 2020-12-12 11:32

    Try this as it worked for me:

    Press Windows+R or open run from Start.

    Now type %temp% and delete everything from there...

    Now open Run again and type prefetch and delete everything from there also.

    Now open VS and see the performance.

    0 讨论(0)
  • 2020-12-12 11:32

    About how long is "Some time"? (eg, Hours? Days?)

    It could be as simple as you've run out of RAM.. Ctrl-Shift-Esc will load the Process Monitor where you can see your memory utilization, and kill hogs. Once it's run low, your linkers will slow down trying to swap memory to disk (and Windows doesn't typically report swap overhead unless you turn on System utilization). Depending on the size of your project, Linking can use HUGE amounts of memory making tables.

    0 讨论(0)
  • 2020-12-12 11:35

    I had the same issue. Deleting the hidden .vs folder in the solution directory solved the problem.

    0 讨论(0)
  • 2020-12-12 11:36

    If there are many project in a single solution, try building the changed one only rather than building the whole solution. Namely, Alt+B+U rather than Alt+B+B.

    0 讨论(0)
  • 2020-12-12 11:36

    Take a Backup of Files and Delete everything in the folder in this folder.

    C:\Users\{username}\AppData\Local\Microsoft\WebsiteCache

    Restart Visual Studio and Check the performance.

    Hope this helps! Thanks

    0 讨论(0)
提交回复
热议问题