Hey, I was trying to learn creating custom packages, and I moved my code from Assets folder to Packages folder. After this transfer, I realized that Rider is not analyzing the code.
Even if I try to enable the highlight, it just shown lots of error, as cannot resolve Unity
The fact that, in my other Unity project, I set analyzing on, in my other Unity project but ah… I don’t remember how I achieved that. So what’s the solution for this?
Also as shown, CircularUI (which is the code that I’m working on) inside of the packages folder
In project settings or preferences find either the external editor section and tick the checkbox for packages. Or perhaps simply recreate the csproj files and restart rider.
Now I enabled all boxes but still in same situation, also I believe I should only tick embedded packages box. And I regenerated project files, but still rider not analyzing the code in Packages folder.
The package compiles in Unity without errors? And its listed in Unity under Packages respectively Package Manager?
If it’s an embedded package (located under PackageCache) move it to its own folder separate from the project and pick the “add from disk” option. That way you can use it in multiple project and put it under source control. Not sure if this changes the behaviour though, but that’s the recommended workflow.
Manually deleting the .csproj and .sln as well as the .idea folder might also help.
Yes there are no compilation error. I can not add the project from disk, because I still work on the project, if I add it this way some of the assets will be not editable, however even when I add the package this way, still analyzing is disabled.
I’m not home right now, tonight I will try to copy the .idea folder of the project which aı telled that in other project analyze works, so if it related with rider settings it may work.
And for removing .csproj and .sln, I haven’t tried .sln, but not working for .csproj.
How come?
“by disk” packages are not read-only and if you can’t select the assets in the package you only need to change the package visibility (select package.json in project view, visibility is a dropdown in Inspector)
I wouldn’t copy the .idea folder from elsewhere, this contains project specific settings. Backup the folder and delete it, let Rider recreate it, and if that doesn’t fix it close Rider again and restore the previous .idea folder so you don’t lose any settings.
I do remember having had the occassional issue like yours but it was usually only a single file, not an entire project. Haven’t had this issue for a while, definitely not in 2023.3 and it was always fixed either by restarting Rider or re-enabling the anaylsis setting.
Perhaps there is a setting that turns off analysis completely for a given .csproj? Did you try clicking the “OFF” label in your first screenshot?
God! I finally solved the issue, I thank you both for helping. The problem caused because I didn’t create assembly definition for my code. Ahh it’s a silly mistake…