I use Visual Studio 2019 as “External Script Editor” in Unity. When I click “Assets > Open C# Project” from Unity’s main menu, it opens Visual Studio 2019.
Depending on the Visual Studio Solution complexity, it sometimes takes several minutes until Visual Studio has finished opening the solution. During this time, while Visual Studio is opening the solution, Unity is unresponsive.
“Unity is unresponsive” means I cannot work inside Unity during this time.
Please improve “Open C# Project”, so that the Unity editor keeps responsive while Visual Studio is opening the Solution and I can continue to work inside Unity editor while VS is opening the solution.
I’m not sure I understand what you mean, both Unity and VS are independent from each other; you don’t need to have Unity open to open your project solution in VS.
Only about 500 .cs files across 11 projects. I guess some of the slowdown is also caused by a few VS extensions I’ve installed, plus my computer isn’t new.
However, even if it takes 15s like in your case, we shouldn’t be forced to wait for that. Every second Unity locks me out feels like an eternity and causes me to lose focus, which causes a degradation in my overall productivity.
Yes, I have Avira Anti Virus installed, but I also excluded the VS install directory from real time protection. I’ve also excluded my mostly used Unity projects from RT protection, but I don’t feel a difference.
Unitys issue is not that VS is slow, the issue is that Unity waits for it to finish. Since it’s out of Unity’s control how long another application takes to finish, they should use an approach that does not lock the editor during this time. Whether it takes 10, 15, 30 or 60 seconds all come down to the same problem: it locks me out of Unity.
Probably not much help, but there were different times where opening Visual Studio took significantly longer due to issues with the VS Tools for Unity. Specifically, I remember running into an issue where a significantly number of Assembly Definitions in my problem took VS forever to open. They ended up fixing that in a future version of VS Tools for Unity. It could be possibly worth checking whether downgrading to an earlier version of VS 2019, or getting the latest version of VS 2019, makes any difference.
That doesn’t address the main issue of desynchronizing the two, but assuming Unity won’t change anything here, maybe it can help reduce the impact.