Mam микросервис na podstawie .NET Core 2.2. Używam RawRabbit (wersja 2.0.0-beta9) jako magistrali. Wraz z nim zostały zainstalowane następujące pakiety:
<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" />
Oto jak wygląda mój kontroler:
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}");
}
Problem pojawia się, gdy kod próbuje wykonać następujące czynności:
await _busClient.PublishAsync(model);
Wyjątek, który dostaję, to:
Metoda nie znaleziono: 'Void Newtonsoft.Json.JsonSerializer.set_TypeNameAssemblyFormat(System.Runtime.Сериализация.Форматтеры.форматтерассборка)'.