I haven’t been experiencing this problem before 2019.4.30f1 but after upgrading from 2019.4.29 to 2019.4.30f1, whenever I change to Rider to Unity and compiles, 1/5 times Unity editor freezes (forever).
The last lines I get in the Editor.log are:
Reloading assemblies after finishing script compilation.
Begin MonoManager ReloadAssembly
Native extension for WindowsStandalone target not found
Refreshing native plugins compatible for Editor in 1.25 ms, found 3 plugins.
Preloading 0 native plugins for Editor in 0.00 ms.
It freezes after switching Rider back to Unity when the auto-refresh triggers a re-compile. Unity becomes unresponsive and the only way to fix is to open the task manager and kill Unity - any unsaved scene change will be lost.
This issue started to appear after I upgrade Unity from 2019.4.29 to 2019.4.30f1.
After some browsing online this week, I’ve noticed that some other people starting to have this issue recently with Unity 2019, 2020 and 2021. Many of them are also using Rider and suspecting it is Rider’s fault.
Some people suggested that it’s the Rider that triggers the auto-refreshing that causing Unity to freeze, so I tried to turn off the Auto-Refreshing flag in the Unity/Preference page, and press CTRL+R in Unity to manually trigger the refresh and re-compile inside Unity.
This seems to help a little, previously when I have Auto-Refreshing turned on, it freezes 1/5 of the time, with Auto-Refreshing turned off, it freezes 1/10 of the time (so I am not really buying the Rider’s fault theory - the issue is still there even if I manually refresh in Unity).
Some other issues I am experiencing that might be related:
- After upgrading from 2019.4.28 to 2019.4.29, I started to experience Unity cannot be opened but freeze at that black “Unity” logo when open a project in Unity Hub, similarly, the only way to fix is to kill the Unity process in the task manager and re-open the project in Unity Hub again (this is the main reason I upgraded from 2019.4.29 to 2019.4.30).
- After upgrading from 2019.4.29 to 2019.4.30, other than the refresh/recompile freeze, I also experienced the freeze when entering the Play Mode once or twice, this never happened on my PC when I am using 2019.4.28 or lower version.
Some people also suggest all this freeze mess might be caused Plugin version incompatible with the recent Unity version. This suggestion rings a bell that I did use Odin Inspector to write some custom Always-Executing property info boxes recently (although I really doubt it’s the Odin Inspector’s fault as I always write custom info boxes for the past 2 years and it never becomes a problem).
So here are all the plugins and its I am currently using:
Odin Inspector 3.0.3.0
DOTween v1.2.420
Behaviour Designer Version 1.6.7
Dialogue System for Unity Version 2.2.8
A* Pathfinding Project Pro 4.2.15
Unity and Rider version I am using:
Unity 2019.4.30f1
Rider 2021.2.1