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

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

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

grpc存根根据实现角色配置

 

生成时报错:

File not found.

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

 

 

 修改csproj文件 

 

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

 

 

 

 

参考:

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

 

posted @ 2021-08-25 10:28  wolbo  阅读(480)  评论(0编辑  收藏  举报