简体   繁体   English

我应该如何在C#中使用WellKnownTypes?

[英]How should i use WellKnownTypes with C#?

I am using protobuf and I use Int32Value from https://developers.google.com/protocol-buffers/docs/reference/google.protobuf if I write import "google/protobuf/any.proto"; 我正在使用protobuf,并且如果我编写import "google/protobuf/any.proto";则使用https://developers.google.com/protocol-buffers/docs/reference/google.protobuf中的 import "google/protobuf/any.proto"; i get the following error google/protobuf/any.proto: File not found. 我收到以下错误google/protobuf/any.proto: File not found. I haven't found any documentation about it. 我还没有找到任何有关它的文档。 I can't find a way. 我找不到办法。 How should I use these types? 我应该如何使用这些类型?

I have found an answer. 我找到了答案。 There are proto files on Google.Protobuf.Tools.* package in packages\\Google.Protobuf.Tools.*\\tools\\google\\protobuf. Google.Protobuf.Tools。*包中的原始文件位于package \\ Google.Protobuf.Tools。* \\ tools \\ google \\ protobuf中。 You should add -I=path_to_proto_files_in_nuget and add import "wrappers.proto"; 您应该添加-I=path_to_proto_files_in_nuget并添加import "wrappers.proto"; to the header of your proto file. 到原始文件的标题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM