我有以下代码:
public async Task<IActionResult> Post([FromBody]CreateActivity command)
{
command.Id = Guid.NewGuid();
command.CreatedAt = DateTime.UtcNow;
await _busClient.PublishAsync(command);
return Accepted($"activities/{command.Id}");
}似乎“PublishAsync”方法在RabbitMq中缺失了。这是我的.csproj文件:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.2.0" />
<PackageReference Include="RawRabbit" Version="2.0.0-beta8" />
<PackageReference Include="RawRabbit.DependencyInjection.ServiceCollection" Version="2.0.0-beta8" />
<PackageReference Include="RawRabbit.Operations.Subscribe" Version="2.0.0-beta8" />
</ItemGroup>
</Project>所有其他稳定版本也是如此。

发布于 2019-05-31 12:11:45
从源代码的角度来看,PublishAsync方法似乎定义为RawRabbit.Operations.Publish NuGet pacakge中的扩展方法:
用用于执行BusClient的PublishAsync充实BasicPublish
https://stackoverflow.com/questions/56394412
复制相似问题