Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use interface as event argument with Union-non-attributed interface #612

Closed
dtivel opened this issue Nov 14, 2020 · 0 comments · Fixed by #618
Closed

Unable to use interface as event argument with Union-non-attributed interface #612

dtivel opened this issue Nov 14, 2020 · 0 comments · Fixed by #618
Assignees
Labels
Milestone

Comments

@dtivel
Copy link
Member

dtivel commented Nov 14, 2020

Repro steps:

  1. Clone this fork.
  2. Switch to the repro1 branch.
  3. Open the solution in Visual Studio.
  4. Debug test Repro.

Result: The following exception is thrown:

MessagePack.FormatterNotRegisteredException
  HResult=0x80131500
  Message=MessagePackFormatterTests+Fruit is not registered in resolver: StreamJsonRpc.MessagePackFormatter+ResolverWrapper
  Source=MessagePack
  StackTrace:
   at MessagePack.FormatterResolverExtensions.Throw(Type t, IFormatterResolver resolver)

This is similar to #611; however, the differences are that in this bug the interface type (vs the concrete type) has a formatter and the Union attribute is not used. Plus, the exception is different.

I'd expect that the interface in the event definition would be sufficient hint for StreamJsonRpc to find the registered IFruit formatter.

public event EventHandler<IFruit>? OnFruit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants