Closed Nickmiste closed 2 months ago
Removing all asmdefs from my project fixes the compiler errors, but this isn't ideal. Still looking for a more permanent fix.
Turns out the issue was that I was missing a reference to MagicOnion.Serialization.MessagePack
in the asmdef that contained my code. Closing this as resolved!
The Problem
I've been working with MagicOnion in Unity for a while, and I recently updated my project setup to move off of the deprecated version of gRPC. However, I am now seeing the following compiler errors related to source generation. Note that all three errors are identical apart from the line numbers.
Project Setup
The following packages are installed via the Unity package manager:
The following packages are installed via NuGetForUnity:
I am running this on an Apple Silicon Mac.
In player settings, the scripting backend is set to IL2CPP and the api compatibility level is set to .NET Framework.
I have the source generator setup using
MagicOnionClientGenerationAttribute
. This file, as well as all of my other code, is contained within its own asmdef. As I understand it, this source generation takes the place ofmoc
, but MessagePack still requires its own manual generation step usingmpc
. The error above is shown regardless of whether the file generated withmpc
exists.I should also mention that the shared service interfaces are stored in the server directory outside of the Unity project, and then the Unity project symlinks to them.