JsonSerializer is part of System.Text.Json namespace of .NET Core & .NET 5. Unfortunately it's unavailable in .NET Standard.
Is there any alternative to JsonSerializer.SerializeToUtf8Bytes method available in .NET Standard?
This seems to be alternative:
Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(message))