Using Visual Studio, slow compilation in Unity

I am using Visual Studio to modify the C# scripts in my Unity project, so whenever I make modifications and switch back to Unity, it automatically recompiles, as expected.

However, it sometimes seems to take much longer than it should. For example, in one of my test runs while writing up this post, I simply changed a character in a string, and the “recompiling” icon in the bottom right of the Unity interface spun for a second, then remained still for close to 10 seconds, during which time the Unity interface is unresponsive.

This happens frequently enough (though at seemingly random times) that it’s interrupting my work-flow. It’s additionally frustrating because I have a top of the line computer, and Visual Studio is always able to rebuild the solution instantly, conditioning me to expect the same from Unity.

Has anyone else noticed this? It’s a longshot, but are there any settings I could modifying that might speed things up? I’m really new to Unity, so it might have a really simple solution.

Does anyone else experience delay when switching from Visual Studio back to Unity? Or does Unity rebuild really fast?

Almost every time I switch back to Unity, I have to wait for like 10 seconds. It’s really annoying!

fast for me
but remember that when I didn’t have unity on the antivirus guard exclusion list

Try hitting Ctrl+R to re-import the scripts that have changed.

Hi, I have exactly the same problem since today…

But all was working fine 2 days ago :confused:

did work and stopped now normally implies OS update or security update or you now have something running you didn’t have back then (program or service)

I just use a dual screen I was not using 2 days ago :confused: