c# 根据proto文件自动生成代码配置

选中proto文件 右键属性 设置编译动作 protobuf编译

grpc存根根据实现角色配置

c# proto文件导入报错 File not found. Import "common.proto" was not found or had errors.

 

生成时报错:

File not found.

Import "common.proto" was not found or had errors.

c# proto文件导入报错 File not found. Import "common.proto" was not found or had errors.

 

 

 修改csproj文件 

c# proto文件导入报错 File not found. Import "common.proto" was not found or had errors.

 

指定proto文件根目录  ProtoRoot="protos\"

 c# proto文件导入报错 File not found. Import "common.proto" was not found or had errors.

 

 

 

参考:

https://stackoverflow.com/questions/21134066/error-using-import-in-proto-file/59746779#59746779

 

相关文章: