.NET Core 5 RawRabbit Serializer/Dependency Injection Issue

0

I have microservice based on .NET Core 2.2. I am using RawRabbit (version 2.0.0-beta9) as the service bus. The following packages were installed with it:

<PackageReference Include="RawRabbit" Version="2.0.0-beta9" />
<PackageReference Include="RawRabbit.DependencyInjection.ServiceCollection" Version="2.0.0-beta9" />
<PackageReference Include="RawRabbit.Operations.Publish" Version="2.0.0-beta9" />
<PackageReference Include="RawRabbit.Operations.Subscribe" Version="2.0.0-beta9" />

This is what my controller looks like:

 private readonly IBusClient _busClient;

//...constructor that inits the _busClient

[HttpPost("")]
public async Task<IActionResult> Post([FromBody] CreateActivity model)
{
    model.Id = Guid.NewGuid();
    await _busClient.PublishAsync(model); //Exception thrown here
    return Accepted($"Activities/{model.Name}");
}

The problem occurs when the code tries to do the following:

await _busClient.PublishAsync(model);

The exception I get is:

Method not found: 'Void Newtonsoft.Json.JsonSerializer.set_TypeNameAssemblyFormat(System.Runtime.Serialization.Formatters.FormatterAssemblyStyle)'.

1

0

Seems it's not related to your message broker or publish (by the way It could be better if you mentioned whether the message was received by your consumer or not) But seems somewhere you are using TypeNameAssemblyFormat in newton JSON which is obsolete now according here.

[ObsoleteAttribute("TypeNameAssemblyFormat is obsolete. Use TypeNameAssemblyFormatHandling instead.")]
public FormatterAssemblyStyle TypeNameAssemblyFormat { get; set; }

You should use TypeNameAssemblyFormatHandling. Also see here

2021-11-29 20:34:02

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................