On one of my projects we are using MassTransit to interact with RabbitMQ. After upgrading to MassTransit 8, we noticed that some of our integration tests started to fail.
Here is the specific message contract that was causing the issue:
Notice the tuple type I’m using in the data contract? That is the culprit of this issue. With the upgrade to MassTransit 8, the default serializer has switched from Newtonsoft.Json to System.Text.Json. And although for most Newtonsoft.Json features an equivalent exists in System.Text.Json, this is not the case for everything.
I solved the issue by switching from a ValueTuple to a record type:
Fixed it!
More information
MassTransit–.NET 8 upgrade warnings
Migrate from Newtonsoft.Json to System.Text.Json - .NET | Microsoft Learn