我目前正在尝试在现有的C#ASP .NET Core应用程序中实现gRPC服务器。但是并没有生成C#绑定以在应用程序中使用。我已经安装了以下依赖项:
我已将.proto
文件添加到Protos
项目中的文件夹中。我有以下.proto
配置:
syntax = "proto3";
//Request that comes through from the microservice endpoint
message RegistrationRequest {
string type = 1;
string ipAddress = 2;
}
//Response on the service register endpoint
message RegistrationResponse {
bool accepted = 1;
}
//Request to get API endpoint to use based on type
message HostRequest {
string type = 1;
}
//Response of the host request
message HostResponse {
string ipAddress = 1;
}
//Service for the repository
service ServiceRepoServer {
//Method that will register the endpoint on the repo
rpc RegisterEndpoint (RegistrationRequest) returns (RegistrationResponse) {}
//Method that will return an endpoint based on type
rpc RequestEndpoint (HostRequest) returns (HostResponse) {}
}
我曾尝试清洁和重建,但无济于事。它可能有点小,我在某个地方不见了,但我不确定它是什么。有人有主意吗?
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句