'Go to declaration' opens decompiler rather than script
I'm experimenting with using Rider to manage multiple Unity projects with one solution file. In general everything works well, but there's one issue I wanted some feedback on.
For example, let's say this is my project:
- MySolution (2 projects)
- - UnityProject1
- > Assembly-CSharp
- MonoBehaviour1.cs
- - UnityProject2
- > Assembly-CSharp
- MonoBehaviour2.cs
- FooClass.cs
The code in MonoBehaviour2.cs has a reference to FooClass. If I open MonoBehavior2.cs in Rider and choose 'go to declaration' for FooClass, Rider correctly opens the FooClass.cs script. Both scripts are in the same project, and this works as expected.
However, if MonoBehaviour1.cs has a reference to FooClass and I choose 'go to declaration', Rider will open the decompiler for FooClass rather than the FooClass.cs script.
So Rider seems to be unable to find the source file if the declaration is in another project within the same solution. Is there any way to get Rider to open the correct script when I 'go to declaration' in this case?
Please sign in to leave a comment.
Hi! How do you reference UnityProject2 from UnityProject1? Is it ProjectReference or Reference to a library? With ProjectReference Rider will navigate to the source code instead of decompiling the dll.
Yes, changing the reference to a project reference fixes the problem. Thanks!