Is shproj still a thing? Just use a .NET Standard (2.0 or 2.1) library instead and make it that the build output points to your Unity assets folder so each time you build the library it’ll overwrite the old one.
Here’s a (long) good video showing how to do it properly (interesting things start at 55:00)
I think using Assembly Definitions will get that done for you. Your client code mustn’t depend on the server code assembly, that should be all that’s needed.
You could have a [InitializeOnLoadMethod] in the server assembly that prints Debug.LogError() if you do a client build to confirm that this assembly isn’t in the build.
Thank you for the solution. It’s nice but it still needs to build the dll manually and I have to open two projects at the same time (one Client and one to build shared code).
I don’t quite like dll, I want to change shared code directly inside Unity.
Thank you, I think I should put the shared code into a Custom Package and make an Assembly Definition for it.
I just remembered that Custom Package is an alternative to Shared Project in Unity.