Record type contract

does NSB support record type class serialization?

I am following cqrs and I have command and events and I’d like to convert them to record type.

Hello @ekjuanrejon,

I’m assuming that you’re referring to the new .NET record type language feature?

We don’t officially support .NET 5 for the moment but it’s currently on our radar. Some basic initial smoke tests show no issues when message types are registered as records instead of classes.

Does that answer your question?

Kind regards,

@ekjuanrejon we have been running .net5 in production for a few months now. using the go live license with the RC. we are also using records. so far no issues. Please feel free to ping me if u have questions

@ekjuanrejon @Simon_Cropp,

We’ve done extensive tests on the .NET 5 runtime, but only initial tests on the C# 9 language features. We’re actively working on adding .NET 5 to our support platforms.

In any case, if you encountered any issues while running on .NET 5, our support team always goes out of their way to help our customers move forward.


found an issue. when communicating between a net5 and a net4x endpoints. there is a potential fix here

we are currently experimenting with this workaround until a new newtonsoft is released

Hey Simon,

Could you elaborate on the configuration you used to test this?


@HEskandari an endpoint running net47 communicating with an endpoint running net5. and the messages contain some of the offending types. eg hashset, a generic message where the is an int, and probably many others

@HEskandariif you are planning on including the AssemblyResolve hack inside the nsb json serializer, i would recommend against that. speaking from experience in building Costura, there is a high likelihood you will cause bugs as a side effect, or make other issues more difficult to diagnose

1 Like