Every time I try to write a baker, my code editor freezes (First auto complete stops and after 5-10 seconds freeze occurs). I’ve been using Rider for a long time, and tested the same thing on VS2022, freezes as well. The freeze occurs whenever I start writing the generic part of the baker. Maybe it’s something to do with the code generation. I am currently using Unity 2022.2.14f, should I be using an older version?
Edit: Tested on 2022.2.10f as well, still crashing my IDE. Tested on Rider 2022.3.3
Final update (04/05/2023): The issue has been confirmed and fixed by Rider development team. It’ll be released in next 2023.1 public build!
I am also using Unity 2022.2.14 and Rider 2023.1 and don’t have any freeze issues when editing a baker. It is probably something specific to your development system. And because you experience the issue in two different IDEs it may have to do something with .NET SDK which both uses. I suggest updating both IDEs (Rider and Visual Studio) to the latest version. Updates to Visual Studio may also include SDK updates for example. Furthermore Rider 2023.1 provides new features regarding DOTS/ECS of Unity which improves development experience.
Alright, I found the problem. It seems like rider (and visual studio) is trying to use ARM64 version of the MsBuild for some reason. I’ll update if I find a solution.
Exception
— EXCEPTION #1/2 [Win32Exception]
Message = “An error occurred trying to start process ‘C:\Users\yigit\AppData\Local\JetBrains\Toolbox\apps\Rider\ch-0\231.8109.212\tools\MSBuild\Current\Bin\arm64\MSBuild.exe’ with working directory ‘C:\Users\yigit\AppData\Local\JetBrains\Toolbox\apps\Rider\ch-0\231.8109.212\jbr\bin’. The specified executable is not a valid application for this OS platform.”
ExceptionPath = Root.InnerException
ClassName = System.ComponentModel.Win32Exception
HResult = E_FAIL=EFail=80004005
Source = System.Diagnostics.Process
NativeErrorCode = 216
I’ve managed to fix the issue by uninstalling both Visual Studio and Rider, and installing them back. I believe that this happened because I was learning about Avalonia UI and run some apps on an emulated android device, using both Rider and Visual studio. For some reason, MsBuild was still trying to run using arm64 version of it while doing auto-complete.
Edit: Nevermind, about an hour into programming and crashed while I was writing 5th or 6th baker.
Alright, so it took me whole day but I fixed the issue. After installing Visual Studio and Rider back, I gave a shot on Visual Studio and it all seemed to work fine. Then I tried on Rider, and it worked for first 5 minutes then after a restart to be sure it broke again. I tried multiple times on Visual Studio and it was working fine, which narrowed problem down to Rider.
To fix the issue, go to Settings > Build, Execution, Deployment > Toolset and Build. Over there you will see MSBuild version. I’ve changed it from Automatic to the one inside the Visual Studio folder. It all seems to be working now, hopefully this will help others.
Also, not including Unity.Entities before writing a baker seems to crash it as well. Very weird stuff.
This thread is getting pretty long, hopefully this will be my last post. I’ve reported the issue to the Rider. You can check the status from here.
The issue seems to be about Rider not being able to add using Unity.Entities to the file. If I start writing a baker without the using statement, the whole IDE crashes. If you are experiencing the same crash, just add the using statement before writing a baker, and hope this gets fixed soon.