0

I have 3 C# libraries, it looks like A->B->C.
A.csproj

<ProjectReference Include="..\B.csproj">

B.csproj

<ProjectReference Include="..\C.csproj">

I declared an interface in C

IBall.cs
public interface IBall
{
......
}

A struct in B

Ball.cs
public struct Ball : IBall
{
......
}

In A

BallMessage.cs
[MessagePackObject]
public struct BallMessage
{
   [Key(0)]
   public IBall OutputBall { get; set; }
}

In order to generate AOT code, I have to annotate the interface

IBall.cs
[MessagePack.Union(0, typeof(Ball))]
public interface IBall
{
......
}

Definitely, it won't work, "Ball" could not be found. What should I do? I'm stuck here for a long time.

KZMan
  • 11
  • 2

0 Answers0