ฉันต้อง microservice ฐานอข่ายนอกจากแกนดา 2.2. ฉันใช้ RawRabbit(รุ่น 2.0.0-beta9)เป็นคนบริการรถบัส ต่อไปนี้แพกเกจถูกติดตั้งมัน:
<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" />
นี่คือสิ่งที่ฉัน controller ดูเหมือนว่า:
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}");
}
ปัญหาที่เกิดขึ้นตอนที่รหัสพยายามจะทำต่อไปนี้:
await _busClient.PublishAsync(model);
คนยกเว้นฉันคือ:
วิธีการไม่พบ:'ช่องว่าง Newtonsoft.Json.JsonSerializer.set_TypeNameAssemblyFormat(System.Runtime.Serialization.Formatters.FormatterAssemblyStyle)'.