C# 在protobuf csharp端口2.4.1.473中重建地址簿示例 我已经成功地在ProtoBuff-cSARIP-PORT-2.4.1.47 3源代码中构建了示例AddiScript书项目,甚至还可以从原BooF2.2.1-Wi32中使用C++实例。但是,当我尝试重新生成AddressBookProtos.cs文件并执行它时,我遇到了以下运行时问题 Options: L: List contents A: Add new person Q: Quit Action? a Exception executing action: System.TypeInitializationException: The type initializer for 'Google.ProtocolBuffers.Examples.AddressBook.AddressBook' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos' threw an exception. ---> System.ArgumentException: Invalid embedded descriptor for "tutorial/addressbook.proto". ---> Google.ProtocolBuffers.Descriptors.DescriptorValidationException: tutorial/addressbook.proto: Dependencies passed to FileDescriptor.BuildFrom() don't match those listed in the FileDescriptorProto. at Google.ProtocolBuffers.Descriptors.FileDescriptor.BuildFrom(FileDescriptorProto proto, FileDescriptor[] dependencies) at Google.ProtocolBuffers.Descriptors.FileDescriptor.InternalBuildGeneratedFileFrom(Byte[] descriptorData, FileDescriptor[] dependencies, InternalDescriptorAssigner descriptorAssigner)

C# 在protobuf csharp端口2.4.1.473中重建地址簿示例 我已经成功地在ProtoBuff-cSARIP-PORT-2.4.1.47 3源代码中构建了示例AddiScript书项目,甚至还可以从原BooF2.2.1-Wi32中使用C++实例。但是,当我尝试重新生成AddressBookProtos.cs文件并执行它时,我遇到了以下运行时问题 Options: L: List contents A: Add new person Q: Quit Action? a Exception executing action: System.TypeInitializationException: The type initializer for 'Google.ProtocolBuffers.Examples.AddressBook.AddressBook' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Google.ProtocolBuffers.Examples.AddressBook.AddressBookProtos' threw an exception. ---> System.ArgumentException: Invalid embedded descriptor for "tutorial/addressbook.proto". ---> Google.ProtocolBuffers.Descriptors.DescriptorValidationException: tutorial/addressbook.proto: Dependencies passed to FileDescriptor.BuildFrom() don't match those listed in the FileDescriptorProto. at Google.ProtocolBuffers.Descriptors.FileDescriptor.BuildFrom(FileDescriptorProto proto, FileDescriptor[] dependencies) at Google.ProtocolBuffers.Descriptors.FileDescriptor.InternalBuildGeneratedFileFrom(Byte[] descriptorData, FileDescriptor[] dependencies, InternalDescriptorAssigner descriptorAssigner),c#,.net,protocol-buffers,C#,.net,Protocol Buffers,我尝试使用protos\tutorial\addressbook.proto从protobuf-csharp-port-2.4.1.473-release-binaries生成AddressBookProtos.cs,但它似乎缺少名称空间和伞形类名选项。此外,protobuf-csharp-port-2.4.1.473-source中的src\AddressBook\AddressBookProtos.cs中列出的版本号表示它是“2.3.0.277”。看起来我们有一段时间没有重新生成这些文件了,

我尝试使用protos\tutorial\addressbook.proto从protobuf-csharp-port-2.4.1.473-release-binaries生成AddressBookProtos.cs,但它似乎缺少名称空间和伞形类名选项。此外,protobuf-csharp-port-2.4.1.473-source中的src\AddressBook\AddressBookProtos.cs中列出的版本号表示它是“2.3.0.277”。

看起来我们有一段时间没有重新生成这些文件了,并且在过程中引入了错误。你能在项目页面上提交一个问题吗,等我有机会再看一下?请准确说明您如何重新生成C#文件。根据要求,问题已打开。我发现如果在protoc\中生成AddressBookProto.cs,则AddressBook.exe可以工作。只有在版本4.0中使用protogen.exe时,才会出现此问题。这两个地点的目的是什么?嗯,不确定-那很有趣。等我有时间再看。