VS 2017 - Very slow (laggy) when debugging

前端 未结 16 1460
名媛妹妹
名媛妹妹 2021-01-30 19:51

When I debug my solution, vs 2017 is very laggy and slow it\'s like it has to operate something heavy in the background.

So it stops \"responding\" every 5 seconds for 2

相关标签:
16条回答
  • 2021-01-30 20:14

    I had this problem where the program was running slower if started from visual studio, turned out to be too many threads, like alot of new System.Threading.Thread() in a loop etc. I switched the code to use the ThreadPool instead with Task etc and the slowness went away.

    0 讨论(0)
  • 2021-01-30 20:17

    I experienced same problem. In debug mode, my webforms project ran very slowly. When using Ctrl+ F5, it ran quickly (as it does when deployed). I found a try/catch block that was executing 45 times. It wasn't doing anything, it was just trapping an error that I had made. I fixed the error and, when removing the try-catch block - voila! -- back to full speed.

    So if you're experiencing this problem and you've tried all the solutions above (I did), look for a try catch block that is firing often. [ Fix your error :) ] and then remove the try-catch block. I can't believe the difference it has made. Shouldn't have made any difference at all, of course, since the try-catch block wasn't doing anything, but it did.

    0 讨论(0)
  • 2021-01-30 20:19

    I also experience the lag when "Enable Javascript debugging for ASP.NET (Chrome and IE)" is checked. And Turning off the "Enable Diagnostic Tools while debugging" did not help.

    However, I also noticed that when I F12 for Chrome Developer Tools, then lag time goes away and the app performs.

    Hope this helps.

    0 讨论(0)
  • 2021-01-30 20:20

    I gave up getting Debug=>Attach To Process working... even tried ALL the solutions on this SO post (2-pages worth).

    Solution

    Use ReAttach VS IDE Extension. This bypasses the need to ever use the Attach to Process dialog again if it's a process you've recently attached to.

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