82

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 seconds, which is very annoying. Any suggestions?

EDIT (tried suggestions):

  • Browser Link is turned off
  • Stopped customer feedback
Muarl
  • 1,977
  • 1
  • 14
  • 18
  • 1
    I had this once with BrowserLink running. I turned it off and everything ran smoothly again, may be a red herring but worth a shot. – Chris Dixon Mar 13 '17 at 12:55
  • Thanks, but did not work :/ – Muarl Mar 13 '17 at 13:01
  • 3
    Did you try stopping customer feedback? It's Help --> Send Feedback --> Settings... --> No, I would not like to participate – Ori Nachum Mar 13 '17 at 13:14
  • Unfortunately, yes - I always deny that – Muarl Mar 13 '17 at 13:27
  • Do you have intellitrace turned on? – Ken Tucker Mar 13 '17 at 13:30
  • Yes - with "IntelliTrace events only" enabled | Disabling does also not help. – Muarl Mar 13 '17 at 15:31
  • My problem - similar symptoms, very slow debugging of ASP.NET project - was solved by yet another solution, https://stackoverflow.com/a/22290607/889779 - might be useful for someone who stumble across this question in the future – Paweł Bulwan Nov 21 '17 at 16:25
  • And for people who arrived at this question after 15.8.1 was released: https://developercommunity.visualstudio.com/content/problem/315338/vs-2017-1581-debugging-extremely-slow.html – csrowell Aug 22 '18 at 14:40

16 Answers16

97

After some additional investigation I found this thread Unchecking Enable Diagnostic Tools while debugging in Tools → Options → Debugging → General did the trick!

Unchecking Enable JavaScript debugging for ASP.NET in
Tools → Options → Debugging → General
makes a huge difference in performance.

Hammad Sajid
  • 312
  • 1
  • 3
  • 14
Muarl
  • 1,977
  • 1
  • 14
  • 18
  • 2
    report it to Microsoft so that they can fix it with an update for vs2017: https://learn.microsoft.com/en-us/visualstudio/ide/how-to-report-a-problem-with-visual-studio-2017 – magicandre1981 Mar 13 '17 at 16:06
  • YAY! wow I was losing my mind with "click and wait >5 seconds" for EVERY action... THANKS! – EaziLuizi Mar 16 '17 at 05:30
  • 13
    I have the same issue, but already had "Enable Diagnostic Tools while debugging" disabled, so that doesn't seem to fix it entirely :-( – SirViver Mar 16 '17 at 13:46
  • In our case running in Community was much faster than running in Enterprise. Not sure what feature(s) Enterprise might have that Community does not that would cause this? Anybody have speculations? – Eric Gurney Mar 16 '17 at 19:18
  • YEAH! it worked for me! debugging was a nightmare! big thanks. – nino.porcino Nov 22 '17 at 17:25
  • In addition, also disable IntelliTrace: Tools > Options IntelliTrace. Now FINALLY it will be fast like you remembered it. – Patashu Jun 05 '18 at 01:41
  • 2
    Fixed it for me too. Features like this really shouldn't go out unless they are scalable. – Kit Sep 26 '18 at 13:06
14

If disable Diagnostic Tools don't fix the problem try to disable IntelliTrace, Unchecking Enable IntelliTrace, in Tools -> Options -> IntelliTrace. Work for me.

  • 6
    IntelliTrace is a pretty useful tool. Rather than disabling the whole thing, it's best to just disable the event that is slowing things down. **Tools → Options → IntelliTrace → IntelliTrace Events**. For me, once I **disabled ADO.NET event logging** things were speedy again. – JustMaier May 05 '17 at 22:19
14

I have tried disabling few things myself just to see what is causing it. The only thing that did work for me is Tools > Options > Debugging > General > "Enable JavaScript debugging for ASP.NET (Chrome and IE)".

I'm using VS2017 Enterprise v15.2 for Asp.net WebForms.

afr0
  • 848
  • 1
  • 11
  • 29
4

Hiding the Threads window did the trick for me.

Niels Filter
  • 4,430
  • 3
  • 28
  • 42
  • 1
    Comment on why the downvote? If your app is running with many threads and this window is showing it most certainly slows down the debugging experience significantly – Niels Filter Nov 07 '17 at 09:37
  • 1
    It is mentioned here: [Make Debugging Faster with Visual Studio](https://blogs.msdn.microsoft.com/devops/2015/03/03/make-debugging-faster-with-visual-studio/) – IvanH Nov 10 '17 at 13:56
  • 1
    Yep, this very clearly solved the slowness of the debugger for me! Thanks a lot for the tip! What is strange though is that I always had the "threads" window visible, but the slowness was not always occurring. – Dimitri C. Apr 26 '18 at 09:38
  • Note that it is sufficient to hide the window just by activating another tab, so the "threads" window is not in sight. That is probably the reason why the slowness was sometimes there and sometimes not, depending on which tab page was selected. – Dimitri C. Apr 26 '18 at 10:03
4

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.

kmsellers
  • 51
  • 3
  • Thx. Disabling Enable JavaScript debugging for ASP.NET (Chrome and IE) finally did the trick for me – Nick G. Nov 14 '17 at 19:10
3

Only one thing that helped me was disabling Debugger option of Resharper. If you use Resharper, try to UNCHECK "Show local variables values in editor" in menu: Resharper -> Options -> Tools -> Debugger.

Resharper's Debbuging options

It helped for me.

Community
  • 1
  • 1
2

What worked for me was removing all the following folders in the solution's directory:

  • .vs
  • x64
  • Debug
  • Release
u17
  • 2,776
  • 4
  • 31
  • 43
1

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.

George Beier
  • 236
  • 3
  • 8
1

I also had this problem, for me helped disabling Enable Edit and Continue options in Tools → Options → Debugging → General.

bars222
  • 1,652
  • 3
  • 13
  • 14
0

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.

enter image description here

Community
  • 1
  • 1
SliverNinja - MSFT
  • 31,051
  • 11
  • 110
  • 173
0

If you are using VS 2017 Enterprise edition, try disable IntelliTrace feature (Tools -> Options -> IntelliTrace)

with this feature turned off, the laggy behavior went away even keeping the Diagnostic tools turned on (Tools -> Options -> Debugging -> Enable Diagnostic Tools while debugging)

armadillo.mx
  • 934
  • 1
  • 11
  • 17
  • 4
    There could be many other reasons why your app might get slow while debugging, if the suggested solution above does not work for you doesn't mean it won't in all cases. – armadillo.mx Oct 13 '17 at 18:26
0

Sometimes it is because of a Realtime scan in Antivirus.

"Add exceptions" Visual Studio files/folders for your Antivirus

C: \ Program Files (x86) \ Microsoft Visual Studio \ 2017 \ Professional \ Common7 \ IDE \ devenv.exe

C: \ Program Files (x86) \ Microsoft Visual Studio \ 201

0

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.

colin lamarre
  • 1,714
  • 1
  • 18
  • 25
0

choosing "Load only specified modules" did the trick (Tools=>Options=>Debugging=>Symbols)

James Hao
  • 765
  • 2
  • 11
  • 40
0

In my case I had a break point with a condition that was never met. I had forgotten about about this break point altogether. Sometimes adding a simple condition to a break point can slow down the debugging speed a lot.

Just adding this in case it might help someone.

Fred
  • 187
  • 5
  • 23
-1

workaround that I used was to run msvcmon.exe locally with admin mode before starting the debugger. Then start the attach window and providing the remote debugging port.