Visual Studio takes too long to Attach to Unity

Visual Studio takes too long to “Attack to Unity” so that I can use breakpoints and step through code while playtesting. It didn’t use to take so long while the project was in the earlier stages so I would like to ask if someone has any idea what might be slowing it down so much,be it script count, asset count or something else. It takes around 30-40 seconds from the moment I click on it until I can play the game.

1 Like

In Visual Studio click the menu Debug->Delete All Breakpoints (or CTRL+Shift+F9).

For some reason VS takes longer and longer if you have old breakpoints. Maybe its too many breakpoints, maybe its some old breakpoints that are no longer on valid code locations after lots of edits. Either way, clearing out all breakpoints usually does the trick.

Hi things to try…

  1. Check your exception settings in Visual Studio.
    [Debug][Windows][Exception Settings]
    Turn off “Common Language Runtime Exceptions” unless you are are actually tracking down an exception.

  2. Also you can in the [Debug][Options][debugging][Just-In-Time] options turn off “Native” Just -In_time debugging and that should speed things up as well.

  3. Remove unnecessary breakpoints as suggested above.

Got the same issue. It seemed at first Unity was freezing after I launched attach from VS but it is just painfully slow. Was working fine before.

Yeah it can take the best part of 30 seconds now…

Wifi is versatile but super slow compared to USB because of latency UPSers

Nailed it. Tanks!