I’ve recently been experiencing a problem where I have to constantly click back and forth between unity and rider when debugging or running unit tests. for example
Click run all unit tests in rider… It stalls on pending… I click back on unity, nothing happens, click back on rider, nothing happens, then click on unity, and a little popup appears briefly that I can’t read, but looks like the code refreshing popup, then back to rider, and suddenly all the tests run.
Another possibly related issue, tests in unity take milliseconds to complete, whereas rider (once it finally gets going) takes around 20-30 seconds. It seems to have trouble moving between the different assemblies or something.
Rider’s code coverage isn’t working at all, and crashes unity every time. Everything seemed to be working perfectly a month or two ago but I’ve since updated unity and rider a couple times.
Anyone know of any way to fix this issue which seems to be related to
If your project is not NDA you can privately submit it to https://youtrack.jetbrains.com/issues/RIDER
Or you may try if the problem reproduces with some open-source project on your machine.
Not personally using rider, but I would suggest checking that you have the latest Rider-Unity package installed. If you are on the latest, perhaps try going down one version to see if you have a bug from the current version.
I have been experiencing this way more often (within the last few weeks/months, ever since DOTS 0.50 came out and I had to move my projects back to 2020.x, instead of 2021.x) than I ever have in the past. It is constant. I have Alt+R in Rider mapped to refreshing Unity to compile and now it only works maybe 1 out of every 4-5 times that I try. I have to tab back to Unity, refresh there, then only sometimes when I go back to Rider does it show a connection again back to Unity. Otherwise it just thinks its disconnected / Unity is closed. Yet, most other things work as expected, it’s just super annoying.
I am using Rider 2023.x edition and have been having issues attaching the unity editor.
The only solution that worked for me was to
Make sure you have the latest Rider Editor package in package manager
Close unity editor and rider editor
Navigate to the unity project and remove the *.csproj files (found on the project root folder)
Reopen unity and proceed as normal with debugging with rider
I found deleting the *.csproj files caused unity to regenerate them and it works
Please note that if you go to Preferences/External Tools and click regenerate files that it still does not work. For some reason it does not properly regenerate the csproj files.